use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(PersonExternalIdentifiers extIds) {
Date latestAct = null;
if (extIds != null && extIds.getExternalIdentifiers() != null && !extIds.getExternalIdentifiers().isEmpty()) {
XMLGregorianCalendar latest = extIds.getExternalIdentifiers().get(0).getLastModifiedDate().getValue();
for (PersonExternalIdentifier extId : extIds.getExternalIdentifiers()) {
if (latest.compare(extId.getLastModifiedDate().getValue()) == -1) {
latest = extId.getLastModifiedDate().getValue();
}
}
latestAct = latest.toGregorianCalendar().getTime();
extIds.setLastModifiedDate(new LastModifiedDate(latest));
}
return latestAct;
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(GroupIdRecords groupIdRecords) {
Date latestAct = null;
if (groupIdRecords != null && groupIdRecords.getGroupIdRecord() != null && !groupIdRecords.getGroupIdRecord().isEmpty()) {
XMLGregorianCalendar latest = groupIdRecords.getGroupIdRecord().get(0).getLastModifiedDate().getValue();
for (GroupIdRecord groupid : groupIdRecords.getGroupIdRecord()) {
if (latest.compare(groupid.getLastModifiedDate().getValue()) == -1) {
latest = groupid.getLastModifiedDate().getValue();
}
}
latestAct = latest.toGregorianCalendar().getTime();
groupIdRecords.setLastModifiedDate(new LastModifiedDate(latest));
}
return latestAct;
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(ResearcherUrls researcherUrls) {
Date latestAct = null;
if (researcherUrls != null && researcherUrls.getResearcherUrls() != null && !researcherUrls.getResearcherUrls().isEmpty()) {
XMLGregorianCalendar latest = researcherUrls.getResearcherUrls().get(0).getLastModifiedDate().getValue();
for (ResearcherUrl researcherUrl : researcherUrls.getResearcherUrls()) {
if (latest.compare(researcherUrl.getLastModifiedDate().getValue()) == -1) {
latest = researcherUrl.getLastModifiedDate().getValue();
}
}
latestAct = latest.toGregorianCalendar().getTime();
researcherUrls.setLastModifiedDate(new LastModifiedDate(latest));
}
return latestAct;
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(ActivitiesContainer actContainerRc2) {
Date latestAct = null;
Collection<? extends Activity> activities = actContainerRc2.retrieveActivities();
if (activities != null && !activities.isEmpty()) {
Iterator<? extends Activity> activitiesIterator = activities.iterator();
XMLGregorianCalendar latest = activitiesIterator.next().getLastModifiedDate().getValue();
while (activitiesIterator.hasNext()) {
Activity activity = activitiesIterator.next();
if (latest.compare(activity.getLastModifiedDate().getValue()) == -1) {
latest = activity.getLastModifiedDate().getValue();
}
}
actContainerRc2.setLastModifiedDate(new LastModifiedDate(latest));
latestAct = latest.toGregorianCalendar().getTime();
}
return latestAct;
}
use of org.orcid.jaxb.model.common_v2.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(Emails emails) {
Date latestAct = null;
if (emails != null && emails.getEmails() != null && !emails.getEmails().isEmpty()) {
XMLGregorianCalendar latest = emails.getEmails().get(0).getLastModifiedDate().getValue();
for (Email email : emails.getEmails()) {
if (latest.compare(email.getLastModifiedDate().getValue()) == -1) {
latest = email.getLastModifiedDate().getValue();
}
}
latestAct = latest.toGregorianCalendar().getTime();
emails.setLastModifiedDate(new LastModifiedDate(latest));
}
return latestAct;
}
Aggregations