@Override public OtherNames toOtherNameList(Collection<OtherNameEntity> entities) { if (entities == null) { return null; } List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class); OtherNames otherNames = new OtherNames(); otherNames.setOtherNames(otherNameList); return otherNames; }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { LastModifiedDate theLastModifiedDate; theLastModifiedDate = this.getLastModifiedDate(); strategy.appendField(locator, this, "lastModifiedDate", buffer, theLastModifiedDate); } { List<OtherNameType> theOtherName; theOtherName = (((this.otherName!= null)&&(!this.otherName.isEmpty()))?this.getOtherName():null); strategy.appendField(locator, this, "otherName", buffer, theOtherName); } { String thePath; thePath = this.getPath(); strategy.appendField(locator, this, "path", buffer, thePath); } return buffer; }
public void setSourceName(OtherNames otherNames) { List<OtherName> list = otherNames.getOtherNames(); if (list != null) { for (SourceAware element : list) { setSourceName(element); } } }
public static void setPathToOtherNames(OtherNames otherNames, String orcid) { if (otherNames != null) { otherNames.setPath(OTHER_NAMES.replace("{orcid}", orcid)); if (otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { for (OtherName otherName : otherNames.getOtherNames()) { setPathToOtherName(otherName, orcid); } } } }
public static void calculateLastModified(OtherNames otherNames) { if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { LastModifiedDate latest = null; for (OtherName otherName : otherNames.getOtherNames()) { if (otherName.getLastModifiedDate() != null && otherName.getLastModifiedDate().after(latest)) { latest = otherName.getLastModifiedDate(); } } otherNames.setLastModifiedDate(latest); } }
@Override public PersonalDetails getPersonalDetails(String orcid) { Date lastModified = getLastModifiedDate(orcid); long lastModifiedTime = lastModified.getTime(); PersonalDetails personalDetails = new PersonalDetails(); Name name = recordNameManager.getRecordName(orcid); if (name != null) { personalDetails.setName(name); } Biography bio = biographyManager.getBiography(orcid); if (bio != null) { personalDetails.setBiography(bio); } OtherNames otherNames = otherNameManager.getOtherNames(orcid); OtherNames filteredOtherNames = new OtherNames(); personalDetails.setOtherNames(filteredOtherNames); if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { // Lets copy the list so we don't modify the cached collection List<OtherName> filteredList = new ArrayList<OtherName>(otherNames.getOtherNames()); filteredOtherNames.setOtherNames(filteredList); } if (personalDetails.getLastModifiedDate() == null || personalDetails.getLastModifiedDate().getValue() == null) { personalDetails.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified))); } return personalDetails; }
public static void calculateLastModified(PersonalDetails personalDetails) { if (personalDetails != null) { calculateLastModified(personalDetails.getOtherNames()); LastModifiedDate l1 = personalDetails.getBiography() == null ? null : personalDetails.getBiography().getLastModifiedDate(); LastModifiedDate l2 = personalDetails.getName() == null ? null : personalDetails.getName().getLastModifiedDate(); LastModifiedDate l3 = personalDetails.getOtherNames() == null ? null : personalDetails.getOtherNames().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3); personalDetails.setLastModifiedDate(globalLatest); } }
/** * Create an instance of {@link OtherNames } * */ public OtherNames createOtherNames() { return new OtherNames(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); return result; }
return false; } else if (!otherNames.equals(other.otherNames)) { return false;
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public void setOtherName(List<OtherNameType> value) { this.otherName = null; if (value!= null) { List<OtherNameType> draftl = this.getOtherName(); draftl.addAll(value); } }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
OtherNames filteredOtherNames = new OtherNames(); personalDetails.setOtherNames(filteredOtherNames); if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) { List<OtherName> filteredList = new ArrayList<OtherName>(otherNames.getOtherNames()); filteredOtherNames.setOtherNames(filteredList);
public static void calculateLastModified(Person person) { if (person != null) { calculateLastModified(person.getAddresses()); calculateLastModified(person.getEmails()); calculateLastModified(person.getExternalIdentifiers()); calculateLastModified(person.getKeywords()); calculateLastModified(person.getOtherNames()); calculateLastModified(person.getResearcherUrls()); LastModifiedDate l1 = person.getAddresses() == null ? null : person.getAddresses().getLastModifiedDate(); LastModifiedDate l2 = person.getEmails() == null ? null : person.getEmails().getLastModifiedDate(); LastModifiedDate l3 = person.getExternalIdentifiers() == null ? null : person.getExternalIdentifiers().getLastModifiedDate(); LastModifiedDate l4 = person.getKeywords() == null ? null : person.getKeywords().getLastModifiedDate(); LastModifiedDate l5 = person.getOtherNames() == null ? null : person.getOtherNames().getLastModifiedDate(); LastModifiedDate l6 = person.getResearcherUrls() == null ? null : person.getResearcherUrls().getLastModifiedDate(); LastModifiedDate globalLatest = calculateLatest(l1, l2, l3, l4, l5, l6); person.setLastModifiedDate(globalLatest); } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((addresses == null) ? 0 : addresses.hashCode()); result = prime * result + ((biography == null) ? 0 : biography.hashCode()); result = prime * result + ((emails == null) ? 0 : emails.hashCode()); result = prime * result + ((externalIdentifiers == null) ? 0 : externalIdentifiers.hashCode()); result = prime * result + ((keywords == null) ? 0 : keywords.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((otherNames == null) ? 0 : otherNames.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((researcherUrls == null) ? 0 : researcherUrls.hashCode()); return result; }
if (other.otherNames != null) return false; } else if (!otherNames.equals(other.otherNames)) return false; if (path == null) {
if (otherNames.getOtherNames() != null) { OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
if(otherNames.getOtherNames() != null) { for(OtherName updatedOrNew : otherNames.getOtherNames()) { if(existingOtherName.getId().equals(updatedOrNew.getPutCode())) { deleteMe = false; if(otherNames != null && otherNames.getOtherNames() != null) { for(OtherName updatedOrNew : otherNames.getOtherNames()) { if(updatedOrNew.getPutCode() != null) {
@Override public OtherNames toMinimizedOtherNameList(Collection<OtherNameEntity> entities) { if (entities == null) { return null; } List<OtherName> otherNameList = mapperFacade.mapAsList(entities, OtherName.class); for(OtherName otherName : otherNameList) { otherName.setCreatedDate(null); otherName.setSource(null); } OtherNames otherNames = new OtherNames(); otherNames.setOtherNames(otherNameList); return otherNames; }