001 package org.kuali.ole.patron.api; 002 003 import org.apache.commons.collections.CollectionUtils; 004 import org.apache.commons.lang.StringUtils; 005 import org.kuali.api.jaxb.DateAdapter; 006 import org.kuali.ole.patron.bo.OleAddressBo; 007 import org.kuali.ole.patron.bo.OleBorrowerType; 008 import org.kuali.ole.patron.bo.OlePatronNotes; 009 import org.kuali.rice.core.api.CoreConstants; 010 import org.kuali.rice.core.api.mo.AbstractDataTransferObject; 011 import org.kuali.rice.core.api.mo.ModelBuilder; 012 import org.kuali.rice.kim.api.KimConstants; 013 import org.kuali.rice.kim.api.identity.address.EntityAddress; 014 import org.kuali.rice.kim.api.identity.address.EntityAddressContract; 015 import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliation; 016 import org.kuali.rice.kim.api.identity.affiliation.EntityAffiliationContract; 017 import org.kuali.rice.kim.api.identity.email.EntityEmail; 018 import org.kuali.rice.kim.api.identity.email.EntityEmailContract; 019 import org.kuali.rice.kim.api.identity.employment.EntityEmployment; 020 import org.kuali.rice.kim.api.identity.employment.EntityEmploymentContract; 021 import org.kuali.rice.kim.api.identity.entity.Entity; 022 import org.kuali.rice.kim.api.identity.name.EntityName; 023 import org.kuali.rice.kim.api.identity.name.EntityNameContract; 024 import org.kuali.rice.kim.api.identity.phone.EntityPhone; 025 import org.kuali.rice.kim.api.identity.phone.EntityPhoneContract; 026 import org.w3c.dom.Element; 027 028 import javax.xml.bind.annotation.*; 029 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 030 import java.io.Serializable; 031 import java.util.ArrayList; 032 import java.util.Collection; 033 import java.util.Date; 034 import java.util.List; 035 036 /** 037 * Created with IntelliJ IDEA. 038 * User: ? 039 * Date: 5/24/12 040 * Time: 8:26 PM 041 * To change this template use File | Settings | File Templates. 042 */ 043 @XmlRootElement(name = OlePatronDefinition.Constants.ROOT_ELEMENT_NAME) 044 @XmlAccessorType(XmlAccessType.NONE) 045 @XmlType(name = OlePatronDefinition.Constants.TYPE_NAME, propOrder = { 046 OlePatronDefinition.Elements.PATRON_ID, 047 OlePatronDefinition.Elements.BARCODE, 048 OlePatronDefinition.Elements.BORROWER_TYPE, 049 OlePatronDefinition.Elements.ACITVE_INICATOR, 050 OlePatronDefinition.Elements.GENERAL_BLOCK, 051 OlePatronDefinition.Elements.PAGING_PRIVILEGE, 052 OlePatronDefinition.Elements.COURTESY_NOTICE, 053 OlePatronDefinition.Elements.DELIVERYPRIVILEGE, 054 OlePatronDefinition.Elements.EXPIRATION_DATE, 055 OlePatronDefinition.Elements.ACTIVATION_DATE, 056 057 OlePatronDefinition.Elements.PHONES, 058 OlePatronDefinition.Elements.ADDRESSES, 059 OlePatronDefinition.Elements.NAME, 060 OlePatronDefinition.Elements.EMAILS, 061 OlePatronDefinition.Elements.NOTES, 062 OlePatronDefinition.Elements.OLE_ENTITY_ADDRESSES, 063 OlePatronDefinition.Elements.GENERAL_BLOCK_NOTES, 064 OlePatronDefinition.Elements.INVALID_BARCODE_NUMBER, 065 OlePatronDefinition.Elements.INVALID_BARCODE_NUM_EFF_DATE, 066 OlePatronDefinition.Elements.PATRON_AFFILIATIONS, 067 OlePatronDefinition.Elements.OLE_PROXY_PATRON_DOCS, 068 OlePatronDefinition.Elements.OLE_PATRON_DOCS, 069 070 CoreConstants.CommonElements.VERSION_NUMBER, 071 //CoreConstants.CommonElements.OBJECT_ID, 072 CoreConstants.CommonElements.FUTURE_ELEMENTS 073 }) 074 public final class OlePatronDefinition extends AbstractDataTransferObject implements OlePatronContract{ 075 076 private static final long serialVersionUID = 1L; 077 078 @XmlElement(name = Elements.PATRON_ID, required = false) 079 private final String olePatronId; 080 081 @XmlElement(name = Elements.BARCODE, required = false) 082 private final String barcode; 083 084 @XmlElement(name = Elements.BORROWER_TYPE, required = false) 085 private final String borrowerType; 086 087 @XmlElement(name = Elements.ACITVE_INICATOR, required = false) 088 private final boolean activeIndicator; 089 090 @XmlElement(name = Elements.GENERAL_BLOCK, required = false) 091 private final boolean generalBlock; 092 093 @XmlElement(name = Elements.PAGING_PRIVILEGE, required = false) 094 private final boolean pagingPrivilege; 095 096 @XmlElement(name = Elements.COURTESY_NOTICE, required = false) 097 private final boolean courtesyNotice; 098 099 @XmlElement(name = Elements.DELIVERYPRIVILEGE, required = false) 100 private final boolean deliveryPrivilege; 101 102 @XmlElement(name = Elements.EXPIRATION_DATE, required = false) 103 @XmlJavaTypeAdapter(value=DateAdapter.class, type=Date.class) 104 private final Date expirationDate; 105 106 @XmlElement(name = Elements.ACTIVATION_DATE, required = false) 107 @XmlJavaTypeAdapter(value=DateAdapter.class, type=Date.class) 108 private final Date activationDate; 109 110 @XmlElementWrapper(name = Elements.PHONES, required = false) 111 @XmlElement(name = Elements.PHONE, required = false) 112 private final List<EntityPhone> phones; 113 114 @XmlElementWrapper(name = Elements.ADDRESSES, required = false) 115 @XmlElement(name = Elements.ADDRESS, required = false) 116 private final List<EntityAddress> addresses; 117 118 @XmlElement(name = Elements.NAME, required = false) 119 private final EntityName name; 120 121 @XmlElementWrapper(name = Elements.EMAILS, required = false) 122 @XmlElement(name = Elements.EMAIL, required = false) 123 private final List<EntityEmail> emails; 124 125 @XmlElementWrapper(name = Elements.NOTES, required = false) 126 @XmlElement(name = Elements.NOTE, required = false) 127 private final List<OlePatronNotesDefinition> notes; 128 129 @XmlElementWrapper(name = Elements.OLE_ENTITY_ADDRESSES, required = false) 130 @XmlElement(name = Elements.OLE_ENTITY_ADDRESS, required = false) 131 private final List<OleEntityAddressDefinition> oleEntityAddressBo; 132 133 @XmlElementWrapper(name = Elements.PATRON_AFFILIATIONS, required = false) 134 @XmlElement(name = Elements.PATRON_AFFILIATION, required = false) 135 private final List<OlePatronAffiliationDefinition> patronAffiliations; 136 137 @XmlElementWrapper(name = Elements.OLE_PROXY_PATRON_DOCS, required = false) 138 @XmlElement(name = Elements.OLE_PROXY_PATRON_DOC, required = false) 139 private final List<OleProxyPatronDefinition> oleProxyPatronDocuments; 140 141 @XmlElementWrapper(name = Elements.OLE_PATRON_DOCS, required = false) 142 @XmlElement(name = Elements.OLE_PATRON_DOC, required = false) 143 private final List<OlePatronDefinition> olePatronDocuments; 144 145 @XmlElement(name = Elements.GENERAL_BLOCK_NOTES, required = false) 146 private final String generalBlockNotes; 147 148 @XmlElement(name = Elements.INVALID_BARCODE_NUMBER, required = false) 149 private final String invalidBarcodeNumber; 150 151 @XmlElement(name = Elements.INVALID_BARCODE_NUM_EFF_DATE, required = false) 152 @XmlJavaTypeAdapter(value=DateAdapter.class, type=Date.class) 153 private final Date invalidBarcodeNumEffDate; 154 155 //@XmlElement(name = Elements.OLE_BORROWER_TYPE, required = false) 156 //private final OleBorrowerTypeDefinition oleBorrowerType; 157 158 //@XmlElement(name = Elements.ENTITY, required = false) 159 private final Entity entity; 160 161 @XmlElement(name = CoreConstants.CommonElements.VERSION_NUMBER, required = false) 162 private final Long versionNumber; 163 164 /*@XmlElement(name = CoreConstants.CommonElements.OBJECT_ID, required = false) 165 private final String objectId;*/ 166 @SuppressWarnings("unused") 167 @XmlAnyElement 168 private final Collection<Element> _futureElements = null; 169 170 public OlePatronDefinition() { 171 this.olePatronId = null; 172 this.barcode = null; 173 this.borrowerType = null; 174 this.activeIndicator = false; 175 this.generalBlock = false; 176 this.pagingPrivilege = false; 177 this.courtesyNotice = false; 178 this.deliveryPrivilege = false; 179 this.expirationDate = null; 180 this.activationDate = null; 181 182 this.phones = null; 183 this.addresses = null; 184 this.name = null; 185 this.emails = null; 186 this.notes = null; 187 this.oleEntityAddressBo = null; 188 this.patronAffiliations = null; 189 //this.oleBorrowerType = null; 190 this.entity = null; 191 this.generalBlockNotes = null; 192 this.invalidBarcodeNumber = null; 193 this.invalidBarcodeNumEffDate = null; 194 this.oleProxyPatronDocuments = null; 195 this.olePatronDocuments = null; 196 this.versionNumber = null; 197 //this.objectId = null; 198 } 199 200 201 private OlePatronDefinition(Builder builder) { 202 this.olePatronId = builder.getOlePatronId(); 203 this.barcode = builder.getBarcode(); 204 this.borrowerType = builder.getBorrowerType(); 205 this.activeIndicator = builder.isActiveIndicator(); 206 this.generalBlock = builder.isGeneralBlock(); 207 this.pagingPrivilege = builder.isPagingPrivilege(); 208 this.courtesyNotice = builder.isCourtesyNotice(); 209 this.deliveryPrivilege = builder.isDeliveryPrivilege(); 210 this.expirationDate = builder.getExpirationDate(); 211 this.activationDate = builder.getActivationDate(); 212 this.generalBlockNotes = builder.getGeneralBlockNotes(); 213 this.invalidBarcodeNumber = builder.getInvalidBarcodeNumber(); 214 this.invalidBarcodeNumEffDate = builder.getInvalidBarcodeNumEffDate(); 215 216 this.addresses = new ArrayList<EntityAddress>(); 217 if (!CollectionUtils.isEmpty(builder.getAddresses())) { 218 for (EntityAddress.Builder address : builder.getAddresses()) { 219 this.addresses.add(address.build()); 220 } 221 } 222 223 this.emails = new ArrayList<EntityEmail>(); 224 if (!CollectionUtils.isEmpty(builder.getEmails())) { 225 for (EntityEmail.Builder email : builder.getEmails()) { 226 this.emails.add(email.build()); 227 } 228 } 229 this.phones = new ArrayList<EntityPhone>(); 230 if (!CollectionUtils.isEmpty(builder.getPhones())) { 231 for (EntityPhone.Builder phoneNumber : builder.getPhones()) { 232 this.phones.add(phoneNumber.build()); 233 } 234 } 235 this.name = builder.getName().build(); 236 237 this.notes = new ArrayList<OlePatronNotesDefinition>(); 238 if (!CollectionUtils.isEmpty(builder.getNotes())) { 239 for (OlePatronNotesDefinition.Builder note : builder.getNotes()) { 240 this.notes.add(note.build()); 241 } 242 } 243 244 this.oleEntityAddressBo = new ArrayList<OleEntityAddressDefinition>(); 245 if (!CollectionUtils.isEmpty(builder.getOleEntityAddressBo())) { 246 for (OleEntityAddressDefinition.Builder oleEntityAddress : builder.getOleEntityAddressBo()) { 247 this.oleEntityAddressBo.add(oleEntityAddress.build()); 248 } 249 } 250 251 this.patronAffiliations= new ArrayList<OlePatronAffiliationDefinition>(); 252 if (!CollectionUtils.isEmpty(builder.getPatronAffiliations())) { 253 for (OlePatronAffiliationDefinition.Builder oleAffiliation : builder.getPatronAffiliations()) { 254 this.patronAffiliations.add(oleAffiliation.build()); 255 } 256 } 257 258 this.oleProxyPatronDocuments= new ArrayList<OleProxyPatronDefinition>(); 259 if (!CollectionUtils.isEmpty(builder.getOleProxyPatronDocuments())) { 260 for (OleProxyPatronDefinition.Builder oleProxyPatron : builder.getOleProxyPatronDocuments()) { 261 this.oleProxyPatronDocuments.add(oleProxyPatron.build()); 262 } 263 } 264 265 this.olePatronDocuments= new ArrayList<OlePatronDefinition>(); 266 if (!CollectionUtils.isEmpty(builder.getOlePatronDocuments())) { 267 for (OlePatronDefinition.Builder olePatron : builder.getOlePatronDocuments()) { 268 this.olePatronDocuments.add(olePatron.build()); 269 } 270 } 271 272 this.entity = builder.getEntity().build(); 273 274 this.versionNumber = builder.getVersionNumber(); 275 //this.objectId = builder.getObjectId(); 276 } 277 278 @Override 279 public String getOlePatronId() { 280 return this.olePatronId; 281 } 282 283 @Override 284 public String getBarcode() { 285 return this.barcode; 286 } 287 288 @Override 289 public String getBorrowerType() { 290 return this.borrowerType; 291 } 292 293 @Override 294 public boolean isActiveIndicator() { 295 return this.activeIndicator; 296 } 297 298 @Override 299 public boolean isGeneralBlock() { 300 return this.generalBlock; 301 } 302 303 @Override 304 public boolean isPagingPrivilege() { 305 return this.pagingPrivilege; 306 } 307 308 @Override 309 public boolean isCourtesyNotice() { 310 return this.courtesyNotice; 311 } 312 313 @Override 314 public boolean isDeliveryPrivilege() { 315 return this.deliveryPrivilege; 316 } 317 318 @Override 319 public Date getExpirationDate() { 320 return this.expirationDate; 321 } 322 323 @Override 324 public Date getActivationDate() { 325 return this.activationDate; 326 } 327 328 @Override 329 public List<EntityAddress> getAddresses() { 330 return this.addresses; 331 } 332 333 @Override 334 public List<EntityEmail> getEmails() { 335 return this.emails; 336 } 337 338 @Override 339 public EntityName getName() { 340 return this.name; 341 } 342 343 @Override 344 public List<EntityPhone> getPhones() { 345 return this.phones; 346 } 347 348 @Override 349 public List<OleEntityAddressDefinition> getOleEntityAddressBo() { 350 return this.oleEntityAddressBo; 351 } 352 353 @Override 354 public List<OlePatronAffiliationDefinition> getPatronAffiliations() { 355 return this.patronAffiliations; 356 } 357 358 @Override 359 public List<OleProxyPatronDefinition> getOleProxyPatronDocuments() { 360 return this.oleProxyPatronDocuments; 361 } 362 363 @Override 364 public List<OlePatronDefinition> getOlePatronDocuments() { 365 return this.olePatronDocuments; 366 } 367 368 @Override 369 public String getGeneralBlockNotes() { 370 return this.generalBlockNotes; 371 } 372 373 @Override 374 public String getInvalidBarcodeNumber() { 375 return this.invalidBarcodeNumber; 376 } 377 378 @Override 379 public Date getInvalidBarcodeNumEffDate() { 380 return this.invalidBarcodeNumEffDate; 381 } 382 383 @Override 384 public Entity getEntity() { 385 return this.entity; 386 } 387 388 @Override 389 public String getId() { 390 return this.olePatronId; 391 } 392 393 /* @Override 394 public boolean isActive() { 395 return this.activeIndicator; 396 }*/ 397 398 @Override 399 public Long getVersionNumber() { 400 return this.versionNumber; 401 } 402 403 @Override 404 public List<OlePatronNotesDefinition> getNotes() { 405 return this.notes; 406 } 407 408 //@Override 409 /*public OleBorrowerTypeDefinition getOleBorrowerType() { 410 return this.oleBorrowerType; 411 }*/ 412 413 public static class Builder 414 implements Serializable, ModelBuilder, OlePatronContract 415 { 416 private String olePatronId; 417 private String barcode; 418 private String borrowerType; 419 private boolean activeIndicator; 420 private boolean generalBlock; 421 private boolean pagingPrivilege; 422 private boolean courtesyNotice; 423 private boolean deliveryPrivilege; 424 private Date expirationDate; 425 private Date activationDate; 426 private Date invalidBarcodeNumEffDate; 427 private String generalBlockNotes; 428 private String invalidBarcodeNumber; 429 430 private List<EntityPhone.Builder> phones; 431 private List<EntityAddress.Builder> addresses; 432 private EntityName.Builder name; 433 private List<EntityEmail.Builder> emails; 434 private List<OlePatronNotesDefinition.Builder> notes; 435 private OleBorrowerTypeDefinition.Builder oleBorrowerType; 436 private Entity.Builder entity; 437 private List<OleEntityAddressDefinition.Builder> oleEntityAddressBo; 438 private List<OlePatronAffiliationDefinition.Builder> patronAffiliations; 439 private List<OleProxyPatronDefinition.Builder> oleProxyPatronDocuments; 440 private List<OlePatronDefinition.Builder> olePatronDocuments; 441 442 private Long versionNumber; 443 private String objectId; 444 445 private Builder() { } 446 447 public static Builder create() { 448 return new Builder(); 449 } 450 451 public static Builder create(OlePatronContract contract) { 452 if(contract == null) { 453 throw new IllegalArgumentException("contract was null"); 454 } 455 Builder builder = create(); 456 if (contract.getOlePatronId() != null) { 457 builder.setOlePatronId(contract.getOlePatronId()); 458 } 459 if(contract.getBarcode() != null) { 460 builder.setBarcode(contract.getBarcode()); 461 } 462 if(contract.getBorrowerType() != null) { 463 builder.setBorrowerType(contract.getBorrowerType()); 464 } 465 if(contract.isActiveIndicator()) { 466 builder.setActiveIndicator(contract.isActiveIndicator()); 467 builder.setActive(contract.isActiveIndicator()); 468 } 469 if(contract.isGeneralBlock()) { 470 builder.setGeneralBlock(contract.isGeneralBlock()); 471 } 472 if(contract.isDeliveryPrivilege()) { 473 builder.setDeliveryPrivilege(contract.isDeliveryPrivilege()); 474 } 475 if(contract.isPagingPrivilege()) { 476 builder.setPagingPrivilege(contract.isPagingPrivilege()); 477 } 478 if(contract.isCourtesyNotice()) { 479 builder.setCourtesyNotice(contract.isCourtesyNotice()); 480 } 481 if(contract.getExpirationDate() != null) { 482 builder.setExpirationDate(contract.getExpirationDate()); 483 } 484 if(contract.getActivationDate() != null) { 485 builder.setActivationDate(contract.getActivationDate()); 486 } 487 if(contract.getGeneralBlockNotes() != null) { 488 builder.setGeneralBlockNotes(contract.getGeneralBlockNotes()); 489 } 490 if(contract.getInvalidBarcodeNumber() != null) { 491 builder.setInvalidBarcodeNumber(contract.getInvalidBarcodeNumber()); 492 } 493 if(contract.getInvalidBarcodeNumEffDate()!= null) { 494 builder.setInvalidBarcodeNumEffDate(contract.getInvalidBarcodeNumEffDate()); 495 } 496 497 builder.addresses = new ArrayList<EntityAddress.Builder>(); 498 if (!CollectionUtils.isEmpty(contract.getAddresses())) { 499 for (EntityAddressContract addressContract : contract.getAddresses()) { 500 builder.addresses.add(EntityAddress.Builder.create(addressContract)); 501 } 502 } 503 builder.emails = new ArrayList<EntityEmail.Builder>(); 504 if (!CollectionUtils.isEmpty(contract.getEmails())) { 505 for (EntityEmailContract emailContract : contract.getEmails()) { 506 builder.emails.add(EntityEmail.Builder.create(emailContract)); 507 } 508 } 509 builder.phones = new ArrayList<EntityPhone.Builder>(); 510 if (!CollectionUtils.isEmpty(contract.getPhones())) { 511 for (EntityPhoneContract phoneContract : contract.getPhones()) { 512 builder.phones.add(EntityPhone.Builder.create(phoneContract)); 513 } 514 } 515 builder.oleEntityAddressBo = new ArrayList<OleEntityAddressDefinition.Builder>(); 516 if (!CollectionUtils.isEmpty(contract.getOleEntityAddressBo())) { 517 for (OleEntityAddressContract oleEntityAddressContract : contract.getOleEntityAddressBo()) { 518 builder.oleEntityAddressBo.add(OleEntityAddressDefinition.Builder.create(oleEntityAddressContract)); 519 } 520 } 521 if (contract.getName() != null) { 522 builder.setName(EntityName.Builder.create(contract.getName())); 523 } 524 if (contract.getEntity() != null) { 525 builder.setEntity(Entity.Builder.create(contract.getEntity())); 526 } 527 /*if(contract.getOleBorrowerType() != null) { 528 builder.setOleBorrowerType(OleBorrowerTypeDefinition.Builder.create(contract.getOleBorrowerType())); 529 }*/ 530 builder.notes = new ArrayList<OlePatronNotesDefinition.Builder>(); 531 if (!CollectionUtils.isEmpty(contract.getNotes())) { 532 for(OlePatronNotesContract noteContract : contract.getNotes()) { 533 builder.notes.add(OlePatronNotesDefinition.Builder.create(noteContract)); 534 } 535 } 536 builder.patronAffiliations = new ArrayList<OlePatronAffiliationDefinition.Builder>(); 537 if (!CollectionUtils.isEmpty(contract.getPatronAffiliations())) { 538 for(OlePatronAffiliationContract affiliationContract : contract.getPatronAffiliations()) { 539 builder.patronAffiliations.add(OlePatronAffiliationDefinition.Builder.create(affiliationContract)); 540 } 541 } 542 543 builder.oleProxyPatronDocuments = new ArrayList<OleProxyPatronDefinition.Builder>(); 544 if (!CollectionUtils.isEmpty(contract.getOleProxyPatronDocuments())) { 545 for(OleProxyPatronContract proxyContract : contract.getOleProxyPatronDocuments()) { 546 builder.oleProxyPatronDocuments.add(OleProxyPatronDefinition.Builder.create(proxyContract)); 547 } 548 } 549 builder.olePatronDocuments = new ArrayList<OlePatronDefinition.Builder>(); 550 if (!CollectionUtils.isEmpty(contract.getOlePatronDocuments())) { 551 for(OlePatronContract patronContract : contract.getOlePatronDocuments()) { 552 builder.olePatronDocuments.add(OlePatronDefinition.Builder.create(patronContract)); 553 } 554 } 555 556 builder.setVersionNumber(contract.getVersionNumber()); 557 /*builder.setObjectId(contract.getObjectId()); 558 builder.setActive(contract.isActive());*/ 559 builder.setId(contract.getId()); 560 return builder; 561 } 562 563 564 public OlePatronDefinition build() { 565 return new OlePatronDefinition(this); 566 } 567 568 @Override 569 public String getOlePatronId() { 570 return olePatronId; 571 } 572 573 public void setOlePatronId(String olePatronId) { 574 this.olePatronId = olePatronId; 575 } 576 577 @Override 578 public String getBarcode() { 579 return barcode; 580 } 581 582 public void setBarcode(String barcode) { 583 this.barcode = barcode; 584 } 585 586 @Override 587 public String getBorrowerType() { 588 return borrowerType; 589 } 590 591 592 public void setBorrowerType(String borrowerType) { 593 this.borrowerType = borrowerType; 594 } 595 596 @Override 597 public boolean isActiveIndicator() { 598 return activeIndicator; 599 } 600 601 public void setActiveIndicator(boolean activeIndicator) { 602 this.activeIndicator = activeIndicator; 603 } 604 605 @Override 606 public boolean isGeneralBlock() { 607 return generalBlock; 608 } 609 610 public void setGeneralBlock(boolean generalBlock) { 611 this.generalBlock = generalBlock; 612 } 613 614 @Override 615 public boolean isPagingPrivilege() { 616 return pagingPrivilege; 617 } 618 619 public void setPagingPrivilege(boolean pagingPrivilege) { 620 this.pagingPrivilege = pagingPrivilege; 621 } 622 623 @Override 624 public boolean isCourtesyNotice() { 625 return courtesyNotice; 626 } 627 628 public void setCourtesyNotice(boolean courtesyNotice) { 629 this.courtesyNotice = courtesyNotice; 630 } 631 632 @Override 633 public boolean isDeliveryPrivilege() { 634 return deliveryPrivilege; 635 } 636 637 public void setDeliveryPrivilege(boolean deliveryPrivilege) { 638 this.deliveryPrivilege = deliveryPrivilege; 639 } 640 641 @Override 642 public Date getExpirationDate() { 643 return expirationDate; 644 } 645 646 public void setExpirationDate(Date expirationDate) { 647 this.expirationDate = expirationDate; 648 } 649 650 @Override 651 public Date getActivationDate() { 652 return activationDate; 653 } 654 655 public void setActivationDate(Date activationDate) { 656 this.activationDate = activationDate; 657 } 658 659 @Override 660 public List<EntityPhone.Builder> getPhones() { 661 return phones; 662 } 663 664 public void setPhones(List<EntityPhone.Builder> phones) { 665 this.phones = phones; 666 } 667 668 @Override 669 public List<EntityAddress.Builder> getAddresses() { 670 return addresses; 671 } 672 673 public void setAddresses(List<EntityAddress.Builder> addresses) { 674 this.addresses = addresses; 675 } 676 677 public List<OleProxyPatronDefinition.Builder> getOleProxyPatronDocuments() { 678 return oleProxyPatronDocuments; 679 } 680 681 public void setOleProxyPatronDocuments(List<OleProxyPatronDefinition.Builder> oleProxyPatronDocuments) { 682 this.oleProxyPatronDocuments = oleProxyPatronDocuments; 683 } 684 685 @Override 686 public EntityName.Builder getName() { 687 return name; 688 } 689 690 public void setName(EntityName.Builder name) { 691 this.name = name; 692 } 693 694 @Override 695 public List<EntityEmail.Builder> getEmails() { 696 return emails; 697 } 698 699 public void setEmails(List<EntityEmail.Builder> emails) { 700 this.emails = emails; 701 } 702 703 704 public List<OlePatronNotesDefinition.Builder> getNotes() { 705 return notes; 706 } 707 708 public void setNotes(List<OlePatronNotesDefinition.Builder> notes) { 709 this.notes = notes; 710 } 711 712 public OleBorrowerTypeDefinition.Builder getOleBorrowerType() { 713 return oleBorrowerType; 714 } 715 716 public void setOleBorrowerType(OleBorrowerTypeDefinition.Builder oleBorrowerType) { 717 this.oleBorrowerType = oleBorrowerType; 718 } 719 720 public Date getInvalidBarcodeNumEffDate() { 721 return invalidBarcodeNumEffDate; 722 } 723 724 public void setInvalidBarcodeNumEffDate(Date invalidBarcodeNumEffDate) { 725 this.invalidBarcodeNumEffDate = invalidBarcodeNumEffDate; 726 } 727 728 public String getGeneralBlockNotes() { 729 return generalBlockNotes; 730 } 731 732 public void setGeneralBlockNotes(String generalBlockNotes) { 733 this.generalBlockNotes = generalBlockNotes; 734 } 735 736 public String getInvalidBarcodeNumber() { 737 return invalidBarcodeNumber; 738 } 739 740 public void setInvalidBarcodeNumber(String invalidBarcodeNumber) { 741 this.invalidBarcodeNumber = invalidBarcodeNumber; 742 } 743 744 @Override 745 public Entity.Builder getEntity() { 746 return entity; 747 } 748 749 public void setEntity(Entity.Builder entity) { 750 this.entity = entity; 751 } 752 753 public List<OleEntityAddressDefinition.Builder> getOleEntityAddressBo() { 754 return oleEntityAddressBo; 755 } 756 757 public void setOleEntityAddressBo(List<OleEntityAddressDefinition.Builder> oleEntityAddressBo) { 758 this.oleEntityAddressBo = oleEntityAddressBo; 759 } 760 761 public List<OlePatronAffiliationDefinition.Builder> getPatronAffiliations() { 762 return patronAffiliations; 763 } 764 765 public void setPatronAffiliations(List<OlePatronAffiliationDefinition.Builder> patronAffiliations) { 766 this.patronAffiliations = patronAffiliations; 767 } 768 769 public List<OlePatronDefinition.Builder> getOlePatronDocuments() { 770 return olePatronDocuments; 771 } 772 773 public void setOlePatronDocuments(List<OlePatronDefinition.Builder> olePatronDocuments) { 774 this.olePatronDocuments = olePatronDocuments; 775 } 776 777 @Override 778 public Long getVersionNumber() { 779 return versionNumber; 780 } 781 782 public void setVersionNumber(Long versionNumber) { 783 this.versionNumber = versionNumber; 784 } 785 786 /*@Override 787 public String getObjectId() { 788 return objectId; 789 }*/ 790 791 public void setObjectId(String objectId) { 792 this.objectId = objectId; 793 } 794 795 @Override 796 public String getId() { 797 return this.olePatronId; 798 } 799 800 public boolean isActive() { 801 return this.activeIndicator; 802 } 803 804 public void setActive(boolean active) { 805 this.activeIndicator = active; 806 } 807 808 public void setId(String id) { 809 if (StringUtils.isWhitespace(id)) { 810 throw new IllegalArgumentException("id is blank"); 811 } 812 this.olePatronId = id; 813 } 814 } 815 816 static class Constants { 817 818 final static String ROOT_ELEMENT_NAME = "olePatron"; 819 final static String TYPE_NAME = "OlePatronType"; 820 final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; 821 } 822 823 static class Elements { 824 final static String PATRON_ID = "olePatronId"; 825 //final static String ENTITY_ID = "entityId"; 826 final static String BARCODE = "barcode"; 827 final static String BORROWER_TYPE = "borrowerType"; 828 final static String ACITVE_INICATOR = "activeIndicator"; 829 final static String GENERAL_BLOCK = "generalBlock"; 830 final static String PAGING_PRIVILEGE = "pagingPrivilege"; 831 final static String COURTESY_NOTICE = "courtesyNotice"; 832 final static String DELIVERYPRIVILEGE = "deliveryPrivilege"; 833 final static String EXPIRATION_DATE ="expirationDate"; 834 final static String ACTIVATION_DATE ="activationDate"; 835 836 final static String PHONES = "phones"; 837 final static String PHONE = "phone"; 838 final static String ADDRESSES = "addresses"; 839 final static String ADDRESS = "address"; 840 final static String NAME = "name"; 841 final static String EMAILS = "emails"; 842 final static String EMAIL = "email"; 843 final static String NOTES = "notes"; 844 final static String NOTE = "note"; 845 final static String OLE_BORROWER_TYPE = "oleBorrowerType"; 846 final static String ENTITY = "entity"; 847 final static String OLE_ENTITY_ADDRESSES = "oleEntityAddressBo"; 848 final static String OLE_ENTITY_ADDRESS = "oleEntityAddress"; 849 final static String GENERAL_BLOCK_NOTES = "generalBlockNotes"; 850 final static String INVALID_BARCODE_NUMBER = "invalidBarcodeNumber"; 851 final static String INVALID_BARCODE_NUM_EFF_DATE = "invalidBarcodeNumEffDate"; 852 final static String PATRON_AFFILIATIONS = "patronAffiliations"; 853 final static String PATRON_AFFILIATION = "patronAffiliation"; 854 final static String OLE_PROXY_PATRON_DOCS = "oleProxyPatronDocuments"; 855 final static String OLE_PROXY_PATRON_DOC = "oleProxyPatronDocument"; 856 final static String OLE_PATRON_DOCS = "olePatronDocuments"; 857 final static String OLE_PATRON_DOC = "olePatronDocument"; 858 /* final static String PERSON_AFFILIATIONS = "personAffiliations"; 859 final static String PERSON_EMPLOYMENTS = "personEmployments";*/ 860 } 861 public static class Cache { 862 public static final String NAME = KimConstants.Namespaces.KIM_NAMESPACE_2_0 + "/" + OlePatronDefinition.Constants.TYPE_NAME; 863 } 864 }