@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; OtherNames that = (OtherNames) o; if (getOtherName() != null ? !getOtherName().equals(that.getOtherName()) : that.getOtherName() != null) return false; if (visibility != that.visibility) return false; return true; }
@Override public int hashCode() { int result = getOtherName() != null ? getOtherName().hashCode() : 0; result = 31 * result + (visibility != null ? visibility.hashCode() : 0); return result; }
public void addOtherName(String value, Visibility vis) { if (getOtherName() == null) { setOtherName(new ArrayList<OtherName>()); } getOtherName().add(new OtherName(value, vis)); }
public List<String> getOtherNamesAsStrings() { List<OtherName> otherNames = getOtherName(); List<String> strings = new ArrayList<String>(otherNames.size()); for (OtherName otherName : otherNames) { strings.add(otherName.getContent()); } return strings; }
if(otherNames != null && otherNames.getOtherName() != null) { for(OtherName newOtherName : otherNames.getOtherName()){ if(Objects.equals(value, newOtherName.getContent())) { found = true; if(otherNames != null && otherNames.getOtherName() != null) { for(OtherName newOtherName : otherNames.getOtherName()) { boolean exists = false; if(existingOtherNameEntities != null) {
private OtherNames getOtherNames(ProfileEntity profile) { OtherNames otherNames = new OtherNames(); Visibility mostRestrictive = Visibility.PUBLIC; Set<OtherNameEntity> otherNamesEntitiy = profile.getOtherNames(); if (otherNamesEntitiy != null && otherNamesEntitiy.size() > 0) { for (OtherNameEntity otherNameEntity : otherNamesEntitiy) { //will only be null if there's an issue with the data or you're using this layer directly Visibility vis = (otherNameEntity.getVisibility() != null)?Visibility.valueOf(otherNameEntity.getVisibility()):Visibility.PRIVATE; if (vis.isMoreRestrictiveThan(mostRestrictive)) mostRestrictive = vis; OtherName otherName = new OtherName(otherNameEntity.getDisplayName(), vis); if(!PojoUtil.isEmpty(otherNameEntity.getElementSourceId())) { Source source = getSource(otherNameEntity); otherName.setSource(source); } otherNames.getOtherName().add(otherName); } } otherNames.setVisibility(mostRestrictive); return otherNames; }
profileIndexDocument.setGivenNames(personalDetails.getGivenNames() != null ? personalDetails.getGivenNames().getContent() : null); profileIndexDocument.setCreditName(personalDetails.getCreditName() != null ? personalDetails.getCreditName().getContent() : null); List<OtherName> otherNames = personalDetails.getOtherNames() != null ? personalDetails.getOtherNames().getOtherName() : null; if (otherNames != null && !otherNames.isEmpty()) { List<String> names = new ArrayList<String>();
OrcidBio bio = orcidProfile.getOrcidBio(); if (bio.getPersonalDetails() != null && bio.getPersonalDetails().getOtherNames() != null && bio.getPersonalDetails().getOtherNames().getOtherName() != null && !bio.getPersonalDetails().getOtherNames().getOtherName().isEmpty()) { for (OtherName otherName : bio.getPersonalDetails().getOtherNames().getOtherName()) { if (otherName.getSource() == null || PojoUtil.isEmpty(otherName.getSource().retrieveSourcePath())) { otherName.setSource(source);
OtherNames n = orcidMessage.getOrcidProfile().getOrcidBio().getPersonalDetails().getOtherNames(); if(n != null) { n.setVisibility(getMostFromCollection(n.getOtherName()));
OtherNames otherNames = orcidBio.getPersonalDetails().getOtherNames(); if(otherNames != null) { List<OtherName> otherNameList = otherNames.getOtherName(); if(otherNameList != null) { for(OtherName otherName : otherNameList) {
for (OtherName x : orcidProfile.getOrcidBio().getPersonalDetails().getOtherNames().getOtherName()) { if (isClaimed) { x.setVisibility(defaultActivityVis);