public static void calculateLastModified(ActivitiesContainer actContainerV2) { if(actContainerV2 != null) { Collection<? extends Activity> activities = actContainerV2.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(); } } actContainerV2.setLastModifiedDate(new LastModifiedDate(latest)); } } }
public static LastModifiedDate calculateLatest(LastModifiedDate ... dates) { LastModifiedDate latest = null; for(LastModifiedDate obj : dates) { if(obj != null) { if(obj.after(latest)) { latest = obj; } } } return latest; } }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public String toString() { final ToStringStrategy strategy = JAXBToStringStrategy.INSTANCE; final StringBuilder buffer = new StringBuilder(); append(null, buffer, strategy); return buffer.toString(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((groupIdRecord == null) ? 0 : groupIdRecord.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + page; result = prime * result + pageSize; result = prime * result + total; return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; GroupIdRecords other = (GroupIdRecords) obj; if (groupIdRecord == null) { if (other.groupIdRecord != null) return false; } else if (!groupIdRecord.equals(other.groupIdRecord)) return false; if (lastModifiedDate == null) { if (other.lastModifiedDate != null) return false; } else if (!lastModifiedDate.equals(other.lastModifiedDate)) return false; if (page != other.page) return false; if (pageSize != other.pageSize) return false; if (total != other.total) return false; return true; }
/** * Create an instance of {@link LastModifiedDate } * */ public LastModifiedDate createLastModifiedDate() { return new LastModifiedDate(); }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder append(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { strategy.appendStart(locator, this, buffer); appendFields(locator, buffer, strategy); strategy.appendEnd(locator, this, buffer); return buffer; }
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-04-24T11:17:38-05:00", comments = "JAXB RI v2.2.11") public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) { { XMLGregorianCalendar theValue; theValue = this.getValue(); strategy.appendField(locator, this, "value", buffer, theValue); } return buffer; }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((content == null) ? 0 : content.hashCode()); result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((visibility == null) ? 0 : visibility.hashCode()); return result; }
if (other.lastModifiedDate != null) return false; } else if (!lastModifiedDate.equals(other.lastModifiedDate)) return false; if (path == null) {
@Override public Biography getBiography(String orcid) { BiographyEntity biographyEntity = null; try { biographyEntity = biographyDao.getBiography(orcid, getLastModified(orcid)); } catch(Exception e) { LOGGER.debug("Couldn't find biography for " + orcid); } if(biographyEntity != null) { Biography bio = new Biography(); bio.setContent(biographyEntity.getBiography()); bio.setVisibility(Visibility.valueOf(biographyEntity.getVisibility())); bio.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getLastModified()))); bio.setCreatedDate(new CreatedDate(DateUtils.convertToXMLGregorianCalendar(biographyEntity.getDateCreated()))); return bio; } return null; }
@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; }
Literal when = calendarAsLiteral(history.getLastModifiedDate().getValue(), m); profileDoc.addLiteral(PAV.lastUpdateOn, when); profileDoc.addLiteral(PROV.generatedAtTime, when);
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((groupId == null) ? 0 : groupId.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((putCode == null) ? 0 : putCode.hashCode()); result = prime * result + ((source == null) ? 0 : source.hashCode()); result = prime * result + ((type == null) ? 0 : type.hashCode()); return result; }
if (other.lastModifiedDate != null) return false; } else if (!lastModifiedDate.equals(other.lastModifiedDate)) return false; if (path == null) {
history.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(profile.getLastModified())));
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); } }
if (personalDetails.getLastModifiedDate() == null || personalDetails.getLastModifiedDate().getValue() == null) { personalDetails.setLastModifiedDate(new LastModifiedDate(DateUtils.convertToXMLGregorianCalendar(lastModified)));
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((createdDate == null) ? 0 : createdDate.hashCode()); result = prime * result + ((email == null) ? 0 : email.hashCode()); result = prime * result + ((lastModifiedDate == null) ? 0 : lastModifiedDate.hashCode()); result = prime * result + ((path == null) ? 0 : path.hashCode()); result = prime * result + ((putCode == null) ? 0 : putCode.hashCode()); result = prime * result + ((source == null) ? 0 : source.hashCode()); result = prime * result + ((visibility == null) ? 0 : visibility.hashCode()); return result; }