/** * <p>Indicates whether parameter <code>obj</code> is "equal to" this one.</p> * * @param obj to compare. * * @return <code>true</code> when <code>obj</code> is an instance of <code>XMLGregorianCalendar</code> * and {@link #compare(XMLGregorianCalendar obj)} returns {@link DatatypeConstants#EQUAL}, otherwise <code>false</code>. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof XMLGregorianCalendar) { return compare((XMLGregorianCalendar) obj) == DatatypeConstants.EQUAL; } return false; }
public static boolean isFresher(XMLGregorianCalendar theTimestamp, XMLGregorianCalendar refTimestamp) { if (theTimestamp == null) { return false; } if (refTimestamp == null) { return true; } return theTimestamp.compare(refTimestamp) == DatatypeConstants.GREATER; }
@Override public int compare(XMLGregorianCalendar xmlGregorianCalendar) { return this.xmlGregorianCalendar.compare (xmlGregorianCalendar instanceof XMLCalendar ? ((XMLCalendar)xmlGregorianCalendar).xmlGregorianCalendar : xmlGregorianCalendar); }
@Override public int compare(XMLGregorianCalendar xmlGregorianCalendar) { return this.xmlGregorianCalendar.compare (xmlGregorianCalendar instanceof XMLCalendar ? ((XMLCalendar)xmlGregorianCalendar).xmlGregorianCalendar : xmlGregorianCalendar); }
public static int compare(XMLGregorianCalendar o1, XMLGregorianCalendar o2) { if (o1 == null && o2 == null) { return 0; } if (o1 == null) { return -1; } if (o2 == null) { return 1; } return o1.compare(o2); }
public static void assertBetween(String message, XMLGregorianCalendar start, XMLGregorianCalendar end, XMLGregorianCalendar actual) { assertNotNull(message + " is null", actual); if (start != null) { assertTrue(message+": expected time to be after "+start+" but it was "+actual, actual.compare(start) == DatatypeConstants.GREATER || actual.compare(start) == DatatypeConstants.EQUAL); } if (end != null) { assertTrue(message+": expected time to be before "+end+" but it was "+actual, actual.compare(end) == DatatypeConstants.LESSER || actual.compare(end) == DatatypeConstants.EQUAL); } }
/** Compare date times, including "indeterminate" rather than applying locale timezone */ private static int compareXSDDateTime(XMLGregorianCalendar dt1, XMLGregorianCalendar dt2) { // Returns codes are -1/0/1 but also 2 for "Indeterminate" // which occurs when one has a timezone and one does not // and they are less then 14 hours apart. // F&O has an "implicit timezone" - this code implements the XMLSchema // compare algorithm. int x = dt1.compare(dt2) ; return convertComparison(x) ; }
private static int compareXSDDateTime(XMLGregorianCalendar dt1 , XMLGregorianCalendar dt2) { // Returns codes are -1/0/1 but also 2 for "Indeterminate" // which occurs when one has a timezone and one does not // and they are less then 14 hours apart. // F&O has an "implicit timezone" - this code implements the XMLSchema compare algorithm. int x = dt1.compare(dt2) ; return convertComparison(x) ; }
private int compare(XMLGregorianCalendar first, XMLGregorianCalendar second) { XMLGregorianCalendar normal1 = normalize(first); XMLGregorianCalendar normal2 = normalize(second); return normal1.compare(normal2); }
public static LastModifiedDate returnLatestLastModifiedDate(LastModifiedDate latest, LastModifiedDate temp) { if (temp == null) { return latest; } if (latest == null) { return temp; } if (latest.getValue().compare(temp.getValue()) == -1) { return temp; } return latest; }
public boolean after(LastModifiedDate other) { if(this.value == null) { return false; } if(other == null || other.getValue() == null) { return true; } return other.getValue().compare(this.value) < 0; } }
public boolean after(LastModifiedDate other) { if(this.value == null) { return false; } if(other == null || other.getValue() == null) { return true; } return other.getValue().compare(this.value) < 0; } }
public boolean after(LastModifiedDate other) { if(this.value == null) { return false; } if(other == null || other.getValue() == null) { return true; } return other.getValue().compare(this.value) < 0; } }
public boolean after(LastModifiedDate other) { if(this.value == null) { return false; } if(other == null || other.getValue() == null) { return true; } return other.getValue().compare(this.value) < 0; } }
@Override public int compare(Rc lRc, Rc rRc) { int result = rRc.getTimestamp().compare(lRc.getTimestamp()); return result; } });
private int compare(XMLGregorianCalendar first, XMLGregorianCalendar second) { XMLGregorianCalendar normal1 = normalize(first); XMLGregorianCalendar normal2 = normalize(second); return normal1.compare(normal2); }
public int compare(Data a, Data b) { return a.getRecord().compare(b.getRecord()); } }
public boolean after(LastModifiedDate other) { if(this.value == null) { return false; } if(other == null || other.getValue() == null) { return true; } return other.getValue().compare(this.value) < 0; } }
@Override public int compare(Rc lRc, Rc rRc) { int result = lRc.getTitle().compareTo(rRc.getTitle()); if (result == 0) { result = rRc.getTimestamp().compare(lRc.getTimestamp()); } return result; } });
public static void addTo(EnvironmentalPerformanceInformationType rv, EnvironmentalPerformanceInformationType delta) { addProvisioningTo(rv, delta.getProvisioningStatistics()); addMappingsTo(rv, delta.getMappingsStatistics()); addNotificationsTo(rv, delta.getNotificationsStatistics()); if (delta.getLastMessageTimestamp() != null) { if (rv.getLastMessageTimestamp() == null || rv.getLastMessageTimestamp().compare(delta.getLastMessageTimestamp()) == DatatypeConstants.LESSER) { rv.setLastMessageTimestamp(delta.getLastMessageTimestamp()); rv.setLastMessage(delta.getLastMessage()); } } }