/** * {@inheritDoc} */ public int compareTo( org.modeshape.graph.property.DateTime that ) { long diff = this.getMillisecondsInUtc() - that.getMillisecondsInUtc(); return diff == 0 ? 0 : diff > 0 ? 1 : -1; }
/** * {@inheritDoc} */ @Override public boolean equals( Object obj ) { if (obj == this) return true; if (obj instanceof org.modeshape.graph.property.DateTime) { org.modeshape.graph.property.DateTime that = (org.modeshape.graph.property.DateTime)obj; return this.getMillisecondsInUtc() == that.getMillisecondsInUtc(); } if (obj instanceof DateTime) { DateTime that = (DateTime)obj; return this.getMillisecondsInUtc() == that.withZone(UTC_ZONE).getMillis(); } return false; }