public static LastModifiedDate calculateLatest(LastModifiedDate ... dates) { LastModifiedDate latest = null; for(LastModifiedDate obj : dates) { if(obj != null) { if(obj.after(latest)) { latest = obj; } } } return latest; } }
public static void calculateLastModified(Group group) { Collection<? extends GroupableActivity> activities = group.getActivities(); if (activities != null && !activities.isEmpty()) { Iterator<? extends GroupableActivity> activitiesIterator = activities.iterator(); LastModifiedDate latest = null; while (activitiesIterator.hasNext()) { GroupableActivity activity = activitiesIterator.next(); if (activity.getLastModifiedDate() != null && activity.getLastModifiedDate().after(latest)) { latest = activity.getLastModifiedDate(); } } group.setLastModifiedDate(latest); } }
public static void calculateLastModified(GroupsContainer groupsContainerV2) { if (groupsContainerV2.retrieveGroups() != null && !groupsContainerV2.retrieveGroups().isEmpty()) { List<? extends Group> groupsRc1 = new ArrayList<>(groupsContainerV2.retrieveGroups()); List<org.orcid.jaxb.model.record_v2.Group> groupsV2 = new ArrayList<>(groupsContainerV2.retrieveGroups()); if (groupsRc1.get(0).getActivities() != null && !groupsRc1.get(0).getActivities().isEmpty()) { LastModifiedDate latest = null; for (Group group : groupsV2) { calculateLastModified(group); if(group.getLastModifiedDate() != null && group.getLastModifiedDate().after(latest)) { latest = group.getLastModifiedDate(); } } groupsContainerV2.setLastModifiedDate(latest); } } }
public static void calculateLastModified(ResearcherUrls researcherUrls) { if (researcherUrls != null && researcherUrls.getResearcherUrls() != null && !researcherUrls.getResearcherUrls().isEmpty()) { LastModifiedDate latest = null; for (ResearcherUrl researcherUrl : researcherUrls.getResearcherUrls()) { if (researcherUrl.getLastModifiedDate() != null && researcherUrl.getLastModifiedDate().after(latest)) { latest = researcherUrl.getLastModifiedDate(); } } researcherUrls.setLastModifiedDate(latest); } }
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); } }
public static void calculateLastModified(GroupIdRecords groupIdRecords) { if (groupIdRecords != null && groupIdRecords.getGroupIdRecord() != null && !groupIdRecords.getGroupIdRecord().isEmpty()) { LastModifiedDate latest = null; for (GroupIdRecord groupid : groupIdRecords.getGroupIdRecord()) { if (groupid.getLastModifiedDate() != null && groupid.getLastModifiedDate().after(latest)) { latest = groupid.getLastModifiedDate(); } } groupIdRecords.setLastModifiedDate(latest); } }
public static void calculateLastModified(Addresses addresses) { if (addresses != null && addresses.getAddress() != null && !addresses.getAddress().isEmpty()) { LastModifiedDate latest = null; for (Address address : addresses.getAddress()) { if (address.getLastModifiedDate() != null && address.getLastModifiedDate().after(latest)) { latest = address.getLastModifiedDate(); } } addresses.setLastModifiedDate(latest); } }
public static void calculateLastModified(Emails emails) { if (emails != null && emails.getEmails() != null && !emails.getEmails().isEmpty()) { LastModifiedDate latest = null; for (Email email : emails.getEmails()) { if (email.getLastModifiedDate() != null && email.getLastModifiedDate().after(latest)) { latest = email.getLastModifiedDate(); } } emails.setLastModifiedDate(latest); } }
public static void calculateLastModified(PersonExternalIdentifiers extIds) { if (extIds != null && extIds.getExternalIdentifiers() != null && !extIds.getExternalIdentifiers().isEmpty()) { LastModifiedDate latest = null; for (PersonExternalIdentifier extId : extIds.getExternalIdentifiers()) { if (extId.getLastModifiedDate() != null && extId.getLastModifiedDate().after(latest)) { latest = extId.getLastModifiedDate(); } } extIds.setLastModifiedDate(latest); } }
public static void calculateLastModified(Keywords keywords) { if (keywords != null && keywords.getKeywords() != null && !keywords.getKeywords().isEmpty()) { LastModifiedDate latest = null; for (Keyword keyword : keywords.getKeywords()) { if (keyword.getLastModifiedDate() != null && keyword.getLastModifiedDate().after(latest)) { latest = keyword.getLastModifiedDate(); } } keywords.setLastModifiedDate(latest); } }