use of org.orcid.jaxb.model.common_rc4.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_rc4.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_rc4.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_rc4.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;
}
use of org.orcid.jaxb.model.common_rc4.LastModifiedDate in project ORCID-Source by ORCID.
the class Api2_0_rc2_LastModifiedDatesHelper method calculateLatest.
public static Date calculateLatest(Addresses addresses) {
Date latestAct = null;
if (addresses != null && addresses.getAddress() != null && !addresses.getAddress().isEmpty()) {
XMLGregorianCalendar latest = addresses.getAddress().get(0).getLastModifiedDate().getValue();
for (Address address : addresses.getAddress()) {
if (latest.compare(address.getLastModifiedDate().getValue()) == -1) {
latest = address.getLastModifiedDate().getValue();
}
}
latestAct = latest.toGregorianCalendar().getTime();
addresses.setLastModifiedDate(new LastModifiedDate(latest));
}
return latestAct;
}
Aggregations