/** * Create an instance of {@link OtherNames } * */ public OtherNames createOtherNames() { return new OtherNames(); }
@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; }
@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; }
@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; }
OtherNames filteredOtherNames = new OtherNames(); personalDetails.setOtherNames(filteredOtherNames); if (otherNames != null && otherNames.getOtherNames() != null && !otherNames.getOtherNames().isEmpty()) {
OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);
OtherNames filteredOtherNames = new OtherNames(); filteredOtherNames.setOtherNames(new ArrayList<OtherName>(otherNames.getOtherNames())); person.setOtherNames(filteredOtherNames);