| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.rice.kim.api.identity.address; |
| 17 | |
|
| 18 | |
import java.io.Serializable; |
| 19 | |
import java.util.Collection; |
| 20 | |
import javax.xml.bind.annotation.XmlAccessType; |
| 21 | |
import javax.xml.bind.annotation.XmlAccessorType; |
| 22 | |
import javax.xml.bind.annotation.XmlAnyElement; |
| 23 | |
import javax.xml.bind.annotation.XmlElement; |
| 24 | |
import javax.xml.bind.annotation.XmlRootElement; |
| 25 | |
import javax.xml.bind.annotation.XmlType; |
| 26 | |
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; |
| 27 | |
|
| 28 | |
import org.apache.commons.lang.StringUtils; |
| 29 | |
import org.joda.time.DateTime; |
| 30 | |
import org.kuali.rice.core.api.CoreConstants; |
| 31 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
| 32 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
| 33 | |
import org.kuali.rice.core.api.util.jaxb.DateTimeAdapter; |
| 34 | |
import org.kuali.rice.kim.api.KimApiConstants; |
| 35 | |
import org.kuali.rice.kim.api.identity.CodedAttribute; |
| 36 | |
import org.w3c.dom.Element; |
| 37 | |
|
| 38 | 0 | @XmlRootElement(name = EntityAddress.Constants.ROOT_ELEMENT_NAME) |
| 39 | |
@XmlAccessorType(XmlAccessType.NONE) |
| 40 | |
@XmlType(name = EntityAddress.Constants.TYPE_NAME, propOrder = { |
| 41 | |
EntityAddress.Elements.ID, |
| 42 | |
EntityAddress.Elements.ENTITY_TYPE_CODE, |
| 43 | |
EntityAddress.Elements.ENTITY_ID, |
| 44 | |
EntityAddress.Elements.ADDRESS_TYPE, |
| 45 | |
EntityAddress.Elements.ATTENTION_LINE, |
| 46 | |
EntityAddress.Elements.LINE1, |
| 47 | |
EntityAddress.Elements.LINE2, |
| 48 | |
EntityAddress.Elements.LINE3, |
| 49 | |
EntityAddress.Elements.CITY, |
| 50 | |
EntityAddress.Elements.STATE_PROVINCE_CODE, |
| 51 | |
EntityAddress.Elements.POSTAL_CODE, |
| 52 | |
EntityAddress.Elements.COUNTRY_CODE, |
| 53 | |
EntityAddress.Elements.ATTENTION_LINE_UNMASKED, |
| 54 | |
EntityAddress.Elements.LINE1_UNMASKED, |
| 55 | |
EntityAddress.Elements.LINE2_UNMASKED, |
| 56 | |
EntityAddress.Elements.LINE3_UNMASKED, |
| 57 | |
EntityAddress.Elements.CITY_UNMASKED, |
| 58 | |
EntityAddress.Elements.STATE_PROVINCE_CODE_UNMASKED, |
| 59 | |
EntityAddress.Elements.POSTAL_CODE_UNMASKED, |
| 60 | |
EntityAddress.Elements.COUNTRY_CODE_UNMASKED, |
| 61 | |
EntityAddress.Elements.ADDRESS_FORMAT, |
| 62 | |
EntityAddress.Elements.MODIFIED_DATE, |
| 63 | |
EntityAddress.Elements.VALIDATED_DATE, |
| 64 | |
EntityAddress.Elements.VALIDATED, |
| 65 | |
EntityAddress.Elements.NOTE_MESSAGE, |
| 66 | |
EntityAddress.Elements.SUPPRESS_ADDRESS, |
| 67 | |
EntityAddress.Elements.DEFAULT_VALUE, |
| 68 | |
EntityAddress.Elements.ACTIVE, |
| 69 | |
CoreConstants.CommonElements.VERSION_NUMBER, |
| 70 | |
CoreConstants.CommonElements.OBJECT_ID, |
| 71 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
| 72 | |
}) |
| 73 | 0 | public final class EntityAddress extends AbstractDataTransferObject |
| 74 | |
implements EntityAddressContract |
| 75 | |
{ |
| 76 | |
@XmlElement(name = Elements.ID, required = false) |
| 77 | |
private final String id; |
| 78 | |
@XmlElement(name = Elements.ENTITY_TYPE_CODE, required = false) |
| 79 | |
private final String entityTypeCode; |
| 80 | |
@XmlElement(name = Elements.ENTITY_ID, required = false) |
| 81 | |
private final String entityId; |
| 82 | |
@XmlElement(name = Elements.ADDRESS_TYPE, required = false) |
| 83 | |
private final CodedAttribute addressType; |
| 84 | |
@XmlElement(name = Elements.ATTENTION_LINE, required = false) |
| 85 | |
private final String attentionLine; |
| 86 | |
@XmlElement(name = Elements.LINE1, required = false) |
| 87 | |
private final String line1; |
| 88 | |
@XmlElement(name = Elements.LINE2, required = false) |
| 89 | |
private final String line2; |
| 90 | |
@XmlElement(name = Elements.LINE3, required = false) |
| 91 | |
private final String line3; |
| 92 | |
@XmlElement(name = Elements.CITY, required = false) |
| 93 | |
private final String city; |
| 94 | |
@XmlElement(name = Elements.STATE_PROVINCE_CODE, required = false) |
| 95 | |
private final String stateProvinceCode; |
| 96 | |
@XmlElement(name = Elements.POSTAL_CODE, required = false) |
| 97 | |
private final String postalCode; |
| 98 | |
@XmlElement(name = Elements.COUNTRY_CODE, required = false) |
| 99 | |
private final String countryCode; |
| 100 | |
@XmlElement(name = Elements.ATTENTION_LINE_UNMASKED, required = false) |
| 101 | |
private final String attentionLineUnmasked; |
| 102 | |
@XmlElement(name = Elements.LINE1_UNMASKED, required = false) |
| 103 | |
private final String line1Unmasked; |
| 104 | |
@XmlElement(name = Elements.LINE2_UNMASKED, required = false) |
| 105 | |
private final String line2Unmasked; |
| 106 | |
@XmlElement(name = Elements.LINE3_UNMASKED, required = false) |
| 107 | |
private final String line3Unmasked; |
| 108 | |
@XmlElement(name = Elements.CITY_UNMASKED, required = false) |
| 109 | |
private final String cityUnmasked; |
| 110 | |
@XmlElement(name = Elements.STATE_PROVINCE_CODE_UNMASKED, required = false) |
| 111 | |
private final String stateProvinceCodeUnmasked; |
| 112 | |
@XmlElement(name = Elements.POSTAL_CODE_UNMASKED, required = false) |
| 113 | |
private final String postalCodeUnmasked; |
| 114 | |
@XmlElement(name = Elements.COUNTRY_CODE_UNMASKED, required = false) |
| 115 | |
private final String countryCodeUnmasked; |
| 116 | |
@XmlElement(name = Elements.ADDRESS_FORMAT, required = false) |
| 117 | |
private final String addressFormat; |
| 118 | |
@XmlElement(name = Elements.MODIFIED_DATE, required = false) |
| 119 | |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
| 120 | |
private final DateTime modifiedDate; |
| 121 | |
@XmlElement(name = Elements.VALIDATED_DATE, required = false) |
| 122 | |
@XmlJavaTypeAdapter(DateTimeAdapter.class) |
| 123 | |
private final DateTime validatedDate; |
| 124 | |
@XmlElement(name = Elements.VALIDATED, required = false) |
| 125 | |
private final boolean validated; |
| 126 | |
@XmlElement(name = Elements.NOTE_MESSAGE, required = false) |
| 127 | |
private final String noteMessage; |
| 128 | |
@XmlElement(name = Elements.SUPPRESS_ADDRESS, required = false) |
| 129 | |
private final boolean suppressAddress; |
| 130 | |
@XmlElement(name = Elements.DEFAULT_VALUE, required = false) |
| 131 | |
private final boolean defaultValue; |
| 132 | |
@XmlElement(name = Elements.ACTIVE, required = false) |
| 133 | |
private final boolean active; |
| 134 | |
@XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false) |
| 135 | |
private final Long versionNumber; |
| 136 | |
@XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false) |
| 137 | |
private final String objectId; |
| 138 | 0 | @SuppressWarnings("unused") |
| 139 | |
@XmlAnyElement |
| 140 | |
private final Collection<Element> _futureElements = null; |
| 141 | |
|
| 142 | |
|
| 143 | |
|
| 144 | |
|
| 145 | |
|
| 146 | 0 | private EntityAddress() { |
| 147 | 0 | this.entityId = null; |
| 148 | 0 | this.entityTypeCode = null; |
| 149 | 0 | this.addressType = null; |
| 150 | 0 | this.attentionLine = null; |
| 151 | 0 | this.line1 = null; |
| 152 | 0 | this.line2 = null; |
| 153 | 0 | this.line3 = null; |
| 154 | 0 | this.city = null; |
| 155 | 0 | this.stateProvinceCode = null; |
| 156 | 0 | this.postalCode = null; |
| 157 | 0 | this.countryCode = null; |
| 158 | 0 | this.attentionLineUnmasked = null; |
| 159 | 0 | this.line1Unmasked = null; |
| 160 | 0 | this.line2Unmasked = null; |
| 161 | 0 | this.line3Unmasked = null; |
| 162 | 0 | this.cityUnmasked = null; |
| 163 | 0 | this.stateProvinceCodeUnmasked = null; |
| 164 | 0 | this.postalCodeUnmasked = null; |
| 165 | 0 | this.countryCodeUnmasked = null; |
| 166 | 0 | this.addressFormat = null; |
| 167 | 0 | this.modifiedDate = null; |
| 168 | 0 | this.validatedDate = null; |
| 169 | 0 | this.validated = true; |
| 170 | 0 | this.noteMessage = null; |
| 171 | 0 | this.suppressAddress = false; |
| 172 | 0 | this.defaultValue = false; |
| 173 | 0 | this.versionNumber = null; |
| 174 | 0 | this.objectId = null; |
| 175 | 0 | this.active = false; |
| 176 | 0 | this.id = null; |
| 177 | 0 | } |
| 178 | |
|
| 179 | 0 | private EntityAddress(Builder builder) { |
| 180 | 0 | this.entityId = builder.getEntityId(); |
| 181 | 0 | this.entityTypeCode = builder.getEntityTypeCode(); |
| 182 | |
|
| 183 | 0 | this.addressType = (builder.getAddressType() != null) ? builder.getAddressType().build() : null; |
| 184 | 0 | this.attentionLine = builder.getAttentionLine(); |
| 185 | 0 | this.line1 = builder.getLine1(); |
| 186 | 0 | this.line2 = builder.getLine2(); |
| 187 | 0 | this.line3 = builder.getLine3(); |
| 188 | 0 | this.city = builder.getCity(); |
| 189 | 0 | this.stateProvinceCode = builder.getStateProvinceCode(); |
| 190 | 0 | this.postalCode = builder.getPostalCode(); |
| 191 | 0 | this.countryCode = builder.getCountryCode(); |
| 192 | 0 | this.attentionLineUnmasked = builder.getAttentionLineUnmasked(); |
| 193 | 0 | this.line1Unmasked = builder.getLine1Unmasked(); |
| 194 | 0 | this.line2Unmasked = builder.getLine2Unmasked(); |
| 195 | 0 | this.line3Unmasked = builder.getLine3Unmasked(); |
| 196 | 0 | this.cityUnmasked = builder.getCityUnmasked(); |
| 197 | 0 | this.stateProvinceCodeUnmasked = builder.getStateProvinceCodeUnmasked(); |
| 198 | 0 | this.postalCodeUnmasked = builder.getPostalCodeUnmasked(); |
| 199 | 0 | this.countryCodeUnmasked = builder.getCountryCodeUnmasked(); |
| 200 | 0 | this.addressFormat = builder.getAddressFormat(); |
| 201 | 0 | this.modifiedDate = builder.getModifiedDate(); |
| 202 | 0 | this.validatedDate = builder.getValidatedDate(); |
| 203 | 0 | this.validated = builder.isValidated(); |
| 204 | 0 | this.noteMessage = builder.getNoteMessage(); |
| 205 | 0 | this.suppressAddress = builder.isSuppressAddress(); |
| 206 | 0 | this.defaultValue = builder.isDefaultValue(); |
| 207 | 0 | this.versionNumber = builder.getVersionNumber(); |
| 208 | 0 | this.objectId = builder.getObjectId(); |
| 209 | 0 | this.active = builder.isActive(); |
| 210 | 0 | this.id = builder.getId(); |
| 211 | 0 | } |
| 212 | |
|
| 213 | |
@Override |
| 214 | |
public String getEntityId() { |
| 215 | 0 | return this.entityId; |
| 216 | |
} |
| 217 | |
|
| 218 | |
@Override |
| 219 | |
public String getEntityTypeCode() { |
| 220 | 0 | return this.entityTypeCode; |
| 221 | |
} |
| 222 | |
|
| 223 | |
@Override |
| 224 | |
public CodedAttribute getAddressType() { |
| 225 | 0 | return this.addressType; |
| 226 | |
} |
| 227 | |
|
| 228 | |
@Override |
| 229 | |
public String getAttentionLine() { |
| 230 | 0 | return this.attentionLine; |
| 231 | |
} |
| 232 | |
|
| 233 | |
@Override |
| 234 | |
public String getLine1() { |
| 235 | 0 | return this.line1; |
| 236 | |
} |
| 237 | |
|
| 238 | |
@Override |
| 239 | |
public String getLine2() { |
| 240 | 0 | return this.line2; |
| 241 | |
} |
| 242 | |
|
| 243 | |
@Override |
| 244 | |
public String getLine3() { |
| 245 | 0 | return this.line3; |
| 246 | |
} |
| 247 | |
|
| 248 | |
@Override |
| 249 | |
public String getCity() { |
| 250 | 0 | return this.city; |
| 251 | |
} |
| 252 | |
|
| 253 | |
@Override |
| 254 | |
public String getStateProvinceCode() { |
| 255 | 0 | return this.stateProvinceCode; |
| 256 | |
} |
| 257 | |
|
| 258 | |
@Override |
| 259 | |
public String getPostalCode() { |
| 260 | 0 | return this.postalCode; |
| 261 | |
} |
| 262 | |
|
| 263 | |
@Override |
| 264 | |
public String getCountryCode() { |
| 265 | 0 | return this.countryCode; |
| 266 | |
} |
| 267 | |
|
| 268 | |
@Override |
| 269 | |
public String getAttentionLineUnmasked() { |
| 270 | 0 | return this.attentionLineUnmasked; |
| 271 | |
} |
| 272 | |
|
| 273 | |
@Override |
| 274 | |
public String getLine1Unmasked() { |
| 275 | 0 | return this.line1Unmasked; |
| 276 | |
} |
| 277 | |
|
| 278 | |
@Override |
| 279 | |
public String getLine2Unmasked() { |
| 280 | 0 | return this.line2Unmasked; |
| 281 | |
} |
| 282 | |
|
| 283 | |
@Override |
| 284 | |
public String getLine3Unmasked() { |
| 285 | 0 | return this.line3Unmasked; |
| 286 | |
} |
| 287 | |
|
| 288 | |
@Override |
| 289 | |
public String getCityUnmasked() { |
| 290 | 0 | return this.cityUnmasked; |
| 291 | |
} |
| 292 | |
|
| 293 | |
@Override |
| 294 | |
public String getStateProvinceCodeUnmasked() { |
| 295 | 0 | return this.stateProvinceCodeUnmasked; |
| 296 | |
} |
| 297 | |
|
| 298 | |
@Override |
| 299 | |
public String getPostalCodeUnmasked() { |
| 300 | 0 | return this.postalCodeUnmasked; |
| 301 | |
} |
| 302 | |
|
| 303 | |
@Override |
| 304 | |
public String getCountryCodeUnmasked() { |
| 305 | 0 | return this.countryCodeUnmasked; |
| 306 | |
} |
| 307 | |
|
| 308 | |
@Override |
| 309 | |
public String getAddressFormat() { |
| 310 | 0 | return this.addressFormat; |
| 311 | |
} |
| 312 | |
|
| 313 | |
@Override |
| 314 | |
public DateTime getModifiedDate() { |
| 315 | 0 | return modifiedDate; |
| 316 | |
} |
| 317 | |
|
| 318 | |
@Override |
| 319 | |
public DateTime getValidatedDate() { |
| 320 | 0 | return validatedDate; |
| 321 | |
} |
| 322 | |
|
| 323 | |
@Override |
| 324 | |
public boolean isValidated() { |
| 325 | 0 | return validated; |
| 326 | |
} |
| 327 | |
|
| 328 | |
@Override |
| 329 | |
public String getNoteMessage() { |
| 330 | 0 | return noteMessage; |
| 331 | |
} |
| 332 | |
|
| 333 | |
@Override |
| 334 | |
public boolean isSuppressAddress() { |
| 335 | 0 | return this.suppressAddress; |
| 336 | |
} |
| 337 | |
|
| 338 | |
@Override |
| 339 | |
public boolean isDefaultValue() { |
| 340 | 0 | return this.defaultValue; |
| 341 | |
} |
| 342 | |
|
| 343 | |
@Override |
| 344 | |
public Long getVersionNumber() { |
| 345 | 0 | return this.versionNumber; |
| 346 | |
} |
| 347 | |
|
| 348 | |
@Override |
| 349 | |
public String getObjectId() { |
| 350 | 0 | return this.objectId; |
| 351 | |
} |
| 352 | |
|
| 353 | |
@Override |
| 354 | |
public boolean isActive() { |
| 355 | 0 | return this.active; |
| 356 | |
} |
| 357 | |
|
| 358 | |
@Override |
| 359 | |
public String getId() { |
| 360 | 0 | return this.id; |
| 361 | |
} |
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | 0 | public final static class Builder |
| 368 | |
implements Serializable, ModelBuilder, EntityAddressContract |
| 369 | |
{ |
| 370 | |
|
| 371 | |
private String entityId; |
| 372 | |
private String entityTypeCode; |
| 373 | |
private CodedAttribute.Builder addressType; |
| 374 | |
private String attentionLineUnmasked; |
| 375 | |
private String line1Unmasked; |
| 376 | |
private String line2Unmasked; |
| 377 | |
private String line3Unmasked; |
| 378 | |
private String cityUnmasked; |
| 379 | |
private String stateProvinceCodeUnmasked; |
| 380 | |
private String postalCodeUnmasked; |
| 381 | |
private String countryCodeUnmasked; |
| 382 | |
private String addressFormat; |
| 383 | |
private DateTime modifiedDate; |
| 384 | |
private DateTime validatedDate; |
| 385 | |
private boolean validated; |
| 386 | |
private String noteMessage; |
| 387 | |
private boolean suppressAddress; |
| 388 | |
private boolean defaultValue; |
| 389 | |
private Long versionNumber; |
| 390 | |
private String objectId; |
| 391 | |
private boolean active; |
| 392 | |
private String id; |
| 393 | |
|
| 394 | 0 | private Builder() {} |
| 395 | |
|
| 396 | |
public static Builder create() { |
| 397 | 0 | return new Builder(); |
| 398 | |
} |
| 399 | |
|
| 400 | |
public static Builder create(EntityAddressContract contract) { |
| 401 | 0 | if (contract == null) { |
| 402 | 0 | throw new IllegalArgumentException("contract was null"); |
| 403 | |
} |
| 404 | 0 | Builder builder = create(); |
| 405 | 0 | builder.setEntityId(contract.getEntityId()); |
| 406 | 0 | builder.setSuppressAddress(contract.isSuppressAddress()); |
| 407 | 0 | builder.setEntityTypeCode(contract.getEntityTypeCode()); |
| 408 | 0 | if (contract.getAddressType() != null) { |
| 409 | 0 | builder.setAddressType(CodedAttribute.Builder.create(contract.getAddressType())); |
| 410 | |
} |
| 411 | 0 | builder.setAttentionLine(contract.getAttentionLineUnmasked()); |
| 412 | 0 | builder.setLine1(contract.getLine1Unmasked()); |
| 413 | 0 | builder.setLine2(contract.getLine2Unmasked()); |
| 414 | 0 | builder.setLine3(contract.getLine3Unmasked()); |
| 415 | 0 | builder.setCity(contract.getCityUnmasked()); |
| 416 | 0 | builder.setStateProvinceCode(contract.getStateProvinceCodeUnmasked()); |
| 417 | 0 | builder.setPostalCode(contract.getPostalCodeUnmasked()); |
| 418 | 0 | builder.setCountryCode(contract.getCountryCodeUnmasked()); |
| 419 | 0 | builder.setAddressFormat(contract.getAddressFormat()); |
| 420 | 0 | builder.setModifiedDate(contract.getModifiedDate()); |
| 421 | 0 | builder.setValidatedDate(contract.getValidatedDate()); |
| 422 | 0 | builder.setValidated(contract.isValidated()); |
| 423 | 0 | builder.setNoteMessage(contract.getNoteMessage()); |
| 424 | 0 | builder.setDefaultValue(contract.isDefaultValue()); |
| 425 | 0 | builder.setVersionNumber(contract.getVersionNumber()); |
| 426 | 0 | builder.setObjectId(contract.getObjectId()); |
| 427 | 0 | builder.setActive(contract.isActive()); |
| 428 | 0 | builder.setId(contract.getId()); |
| 429 | 0 | return builder; |
| 430 | |
} |
| 431 | |
|
| 432 | |
public EntityAddress build() { |
| 433 | 0 | return new EntityAddress(this); |
| 434 | |
} |
| 435 | |
|
| 436 | |
@Override |
| 437 | |
public String getEntityId() { |
| 438 | 0 | return this.entityId; |
| 439 | |
} |
| 440 | |
|
| 441 | |
@Override |
| 442 | |
public String getEntityTypeCode() { |
| 443 | 0 | return this.entityTypeCode; |
| 444 | |
} |
| 445 | |
|
| 446 | |
@Override |
| 447 | |
public CodedAttribute.Builder getAddressType() { |
| 448 | 0 | return this.addressType; |
| 449 | |
} |
| 450 | |
|
| 451 | |
@Override |
| 452 | |
public String getAttentionLine() { |
| 453 | 0 | if (isSuppressAddress()) { |
| 454 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK; |
| 455 | |
} |
| 456 | 0 | return this.attentionLineUnmasked; |
| 457 | |
|
| 458 | |
} |
| 459 | |
|
| 460 | |
@Override |
| 461 | |
public String getLine1() { |
| 462 | 0 | if (isSuppressAddress()) { |
| 463 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK; |
| 464 | |
} |
| 465 | 0 | return this.line1Unmasked; |
| 466 | |
|
| 467 | |
} |
| 468 | |
|
| 469 | |
@Override |
| 470 | |
public String getLine2() { |
| 471 | 0 | if (isSuppressAddress()) { |
| 472 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK; |
| 473 | |
} |
| 474 | 0 | return this.line2Unmasked; |
| 475 | |
} |
| 476 | |
|
| 477 | |
@Override |
| 478 | |
public String getLine3() { |
| 479 | 0 | if (isSuppressAddress()) { |
| 480 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK; |
| 481 | |
} |
| 482 | 0 | return this.line3Unmasked; |
| 483 | |
} |
| 484 | |
|
| 485 | |
@Override |
| 486 | |
public String getCity() { |
| 487 | 0 | if (isSuppressAddress()) { |
| 488 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK; |
| 489 | |
} |
| 490 | 0 | return this.cityUnmasked; |
| 491 | |
} |
| 492 | |
|
| 493 | |
@Override |
| 494 | |
public String getStateProvinceCode() { |
| 495 | 0 | if (isSuppressAddress()) { |
| 496 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK_CODE; |
| 497 | |
} |
| 498 | 0 | return this.stateProvinceCodeUnmasked; |
| 499 | |
} |
| 500 | |
|
| 501 | |
@Override |
| 502 | |
public String getPostalCode() { |
| 503 | 0 | if (isSuppressAddress()) { |
| 504 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK_ZIP; |
| 505 | |
} |
| 506 | 0 | return this.postalCodeUnmasked; |
| 507 | |
} |
| 508 | |
|
| 509 | |
@Override |
| 510 | |
public String getCountryCode() { |
| 511 | 0 | if (isSuppressAddress()) { |
| 512 | 0 | return KimApiConstants.RestrictedMasks.RESTRICTED_DATA_MASK_CODE; |
| 513 | |
} |
| 514 | 0 | return this.countryCodeUnmasked; |
| 515 | |
} |
| 516 | |
|
| 517 | |
@Override |
| 518 | |
public String getAttentionLineUnmasked() { |
| 519 | 0 | return this.attentionLineUnmasked; |
| 520 | |
} |
| 521 | |
|
| 522 | |
@Override |
| 523 | |
public String getLine1Unmasked() { |
| 524 | 0 | return this.line1Unmasked; |
| 525 | |
} |
| 526 | |
|
| 527 | |
@Override |
| 528 | |
public String getLine2Unmasked() { |
| 529 | 0 | return this.line2Unmasked; |
| 530 | |
} |
| 531 | |
|
| 532 | |
@Override |
| 533 | |
public String getLine3Unmasked() { |
| 534 | 0 | return this.line3Unmasked; |
| 535 | |
} |
| 536 | |
|
| 537 | |
@Override |
| 538 | |
public String getCityUnmasked() { |
| 539 | 0 | return this.cityUnmasked; |
| 540 | |
} |
| 541 | |
|
| 542 | |
@Override |
| 543 | |
public String getStateProvinceCodeUnmasked() { |
| 544 | 0 | return this.stateProvinceCodeUnmasked; |
| 545 | |
} |
| 546 | |
|
| 547 | |
@Override |
| 548 | |
public String getPostalCodeUnmasked() { |
| 549 | 0 | return this.postalCodeUnmasked; |
| 550 | |
} |
| 551 | |
|
| 552 | |
@Override |
| 553 | |
public String getCountryCodeUnmasked() { |
| 554 | 0 | return this.countryCodeUnmasked; |
| 555 | |
} |
| 556 | |
|
| 557 | |
@Override |
| 558 | |
public String getAddressFormat() { |
| 559 | 0 | return this.addressFormat; |
| 560 | |
} |
| 561 | |
|
| 562 | |
@Override |
| 563 | |
public DateTime getModifiedDate() { |
| 564 | 0 | return modifiedDate; |
| 565 | |
} |
| 566 | |
|
| 567 | |
@Override |
| 568 | |
public DateTime getValidatedDate() { |
| 569 | 0 | return validatedDate; |
| 570 | |
} |
| 571 | |
|
| 572 | |
@Override |
| 573 | |
public boolean isValidated() { |
| 574 | 0 | return validated; |
| 575 | |
} |
| 576 | |
|
| 577 | |
@Override |
| 578 | |
public String getNoteMessage() { |
| 579 | 0 | return noteMessage; |
| 580 | |
} |
| 581 | |
|
| 582 | |
@Override |
| 583 | |
public boolean isSuppressAddress() { |
| 584 | 0 | return this.suppressAddress; |
| 585 | |
} |
| 586 | |
|
| 587 | |
@Override |
| 588 | |
public boolean isDefaultValue() { |
| 589 | 0 | return this.defaultValue; |
| 590 | |
} |
| 591 | |
|
| 592 | |
@Override |
| 593 | |
public Long getVersionNumber() { |
| 594 | 0 | return this.versionNumber; |
| 595 | |
} |
| 596 | |
|
| 597 | |
@Override |
| 598 | |
public String getObjectId() { |
| 599 | 0 | return this.objectId; |
| 600 | |
} |
| 601 | |
|
| 602 | |
@Override |
| 603 | |
public boolean isActive() { |
| 604 | 0 | return this.active; |
| 605 | |
} |
| 606 | |
|
| 607 | |
@Override |
| 608 | |
public String getId() { |
| 609 | 0 | return this.id; |
| 610 | |
} |
| 611 | |
|
| 612 | |
public void setEntityId(String entityId) { |
| 613 | 0 | this.entityId = entityId; |
| 614 | 0 | } |
| 615 | |
|
| 616 | |
public void setEntityTypeCode(String entityTypeCode) { |
| 617 | 0 | this.entityTypeCode = entityTypeCode; |
| 618 | 0 | } |
| 619 | |
|
| 620 | |
public void setAddressType(CodedAttribute.Builder addressType) { |
| 621 | 0 | this.addressType = addressType; |
| 622 | 0 | } |
| 623 | |
|
| 624 | |
public void setAttentionLine(String attnLine) { |
| 625 | 0 | this.attentionLineUnmasked = attnLine; |
| 626 | 0 | } |
| 627 | |
|
| 628 | |
public void setLine1(String line1) { |
| 629 | 0 | this.line1Unmasked = line1; |
| 630 | 0 | } |
| 631 | |
|
| 632 | |
public void setLine2(String line2) { |
| 633 | 0 | this.line2Unmasked = line2; |
| 634 | 0 | } |
| 635 | |
|
| 636 | |
public void setLine3(String line3) { |
| 637 | 0 | this.line3Unmasked = line3; |
| 638 | 0 | } |
| 639 | |
|
| 640 | |
public void setCity(String city) { |
| 641 | 0 | this.cityUnmasked = city; |
| 642 | 0 | } |
| 643 | |
|
| 644 | |
public void setStateProvinceCode(String stateProvinceCode) { |
| 645 | 0 | this.stateProvinceCodeUnmasked = stateProvinceCode; |
| 646 | 0 | } |
| 647 | |
|
| 648 | |
public void setPostalCode(String postalCode) { |
| 649 | 0 | this.postalCodeUnmasked = postalCode; |
| 650 | 0 | } |
| 651 | |
|
| 652 | |
public void setCountryCode(String countryCode) { |
| 653 | 0 | this.countryCodeUnmasked = countryCode; |
| 654 | 0 | } |
| 655 | |
|
| 656 | |
public void setAddressFormat(String addressFormat) { |
| 657 | 0 | this.addressFormat = addressFormat; |
| 658 | 0 | } |
| 659 | |
|
| 660 | |
public void setModifiedDate(DateTime modifiedDate) { |
| 661 | 0 | this.modifiedDate = modifiedDate; |
| 662 | 0 | } |
| 663 | |
|
| 664 | |
public void setValidatedDate(DateTime validatedDate) { |
| 665 | 0 | this.validatedDate = validatedDate; |
| 666 | 0 | } |
| 667 | |
|
| 668 | |
public void setValidated(boolean validated) { |
| 669 | 0 | this.validated = validated; |
| 670 | 0 | } |
| 671 | |
|
| 672 | |
public void setNoteMessage(String noteMessage) { |
| 673 | 0 | this.noteMessage = noteMessage; |
| 674 | 0 | } |
| 675 | |
|
| 676 | |
private void setSuppressAddress(boolean suppressAddress) { |
| 677 | 0 | this.suppressAddress = suppressAddress; |
| 678 | 0 | } |
| 679 | |
|
| 680 | |
public void setDefaultValue(boolean defaultValue) { |
| 681 | 0 | this.defaultValue = defaultValue; |
| 682 | 0 | } |
| 683 | |
|
| 684 | |
public void setVersionNumber(Long versionNumber) { |
| 685 | 0 | this.versionNumber = versionNumber; |
| 686 | 0 | } |
| 687 | |
|
| 688 | |
public void setObjectId(String objectId) { |
| 689 | 0 | this.objectId = objectId; |
| 690 | 0 | } |
| 691 | |
|
| 692 | |
public void setActive(boolean active) { |
| 693 | 0 | this.active = active; |
| 694 | 0 | } |
| 695 | |
|
| 696 | |
public void setId(String id) { |
| 697 | 0 | if (StringUtils.isWhitespace(id)) { |
| 698 | 0 | throw new IllegalArgumentException("id is blank"); |
| 699 | |
} |
| 700 | 0 | this.id = id; |
| 701 | 0 | } |
| 702 | |
|
| 703 | |
} |
| 704 | |
|
| 705 | |
|
| 706 | |
|
| 707 | |
|
| 708 | |
|
| 709 | |
|
| 710 | 0 | static class Constants { |
| 711 | |
|
| 712 | |
final static String ROOT_ELEMENT_NAME = "entityAddress"; |
| 713 | |
final static String TYPE_NAME = "EntityAddressType"; |
| 714 | |
} |
| 715 | |
|
| 716 | |
|
| 717 | |
|
| 718 | |
|
| 719 | |
|
| 720 | |
|
| 721 | 0 | static class Elements { |
| 722 | |
|
| 723 | |
final static String ENTITY_ID = "entityId"; |
| 724 | |
final static String ENTITY_TYPE_CODE = "entityTypeCode"; |
| 725 | |
final static String ADDRESS_TYPE = "addressType"; |
| 726 | |
final static String ATTENTION_LINE = "attentionLine"; |
| 727 | |
final static String LINE1 = "line1"; |
| 728 | |
final static String LINE2 = "line2"; |
| 729 | |
final static String LINE3 = "line3"; |
| 730 | |
final static String CITY = "city"; |
| 731 | |
final static String STATE_PROVINCE_CODE = "stateProvinceCode"; |
| 732 | |
final static String POSTAL_CODE = "postalCode"; |
| 733 | |
final static String COUNTRY_CODE = "countryCode"; |
| 734 | |
final static String ATTENTION_LINE_UNMASKED = "attentionLineUnmasked"; |
| 735 | |
final static String LINE1_UNMASKED = "line1Unmasked"; |
| 736 | |
final static String LINE2_UNMASKED = "line2Unmasked"; |
| 737 | |
final static String LINE3_UNMASKED = "line3Unmasked"; |
| 738 | |
final static String CITY_UNMASKED = "cityUnmasked"; |
| 739 | |
final static String STATE_PROVINCE_CODE_UNMASKED = "stateProvinceCodeUnmasked"; |
| 740 | |
final static String POSTAL_CODE_UNMASKED = "postalCodeUnmasked"; |
| 741 | |
final static String COUNTRY_CODE_UNMASKED = "countryCodeUnmasked"; |
| 742 | |
final static String ADDRESS_FORMAT= "addressFormat"; |
| 743 | |
final static String MODIFIED_DATE = "modifiedDate"; |
| 744 | |
final static String VALIDATED_DATE = "validatedDate"; |
| 745 | |
final static String VALIDATED = "validated"; |
| 746 | |
final static String NOTE_MESSAGE = "noteMessage"; |
| 747 | |
final static String SUPPRESS_ADDRESS = "suppressAddress"; |
| 748 | |
final static String DEFAULT_VALUE = "defaultValue"; |
| 749 | |
final static String ACTIVE = "active"; |
| 750 | |
final static String ID = "id"; |
| 751 | |
|
| 752 | |
} |
| 753 | |
|
| 754 | |
} |