@Test public void testToCompare() { assertThat(stats1.compareTo(stats2), is(1)); }
@Override public int compareTo(Timestamp o) { checkArgument(o instanceof MultiValuedTimestamp, "Must be MultiValuedTimestamp", o); MultiValuedTimestamp that = (MultiValuedTimestamp) o; return ComparisonChain.start() .compare(this.value1, that.value1) .compare(this.value2, that.value2) .result(); }
MultiValuedTimestamp implements Timestamp { @Override public int compareTo(Timestamp o) { checkArgument(o instanceof MultiValuedTimestamp, "Must be MultiValuedTimestamp", o); MultiValuedTimestamp that = (MultiValuedTimestamp) o; return ComparisonChain.start() .compare(this.value1, that.value1) .compare(this.value2, that.value2) .result(); } }
MultiValuedTimestamp implements Timestamp { @Override public int compareTo(Timestamp o) { checkArgument(o instanceof MultiValuedTimestamp, "Must be MultiValuedTimestamp", o); MultiValuedTimestamp that = (MultiValuedTimestamp) o; return ComparisonChain.start() .compare(this.value1, that.value1) .compare(this.value2, that.value2) .result(); } MultiValuedTimestamp(T value1, U value2); @SuppressWarnings("unused") private  MultiValuedTimestamp(); }
MultiValuedTimestamp implements Timestamp { @Override public int compareTo(Timestamp o) { checkArgument(o instanceof MultiValuedTimestamp, "Must be MultiValuedTimestamp", o); MultiValuedTimestamp that = (MultiValuedTimestamp) o; return ComparisonChain.start() .compare(this.value1, that.value1) .compare(this.value2, that.value2) .result(); } MultiValuedTimestamp(T value1, U value2); @SuppressWarnings("unused") private  MultiValuedTimestamp(); @Override int compareTo(Timestamp o); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); T value1(); U value2(); }
MultiValuedTimestamp implements Timestamp { @Override public int compareTo(Timestamp o) { checkArgument(o instanceof MultiValuedTimestamp, "Must be MultiValuedTimestamp", o); MultiValuedTimestamp that = (MultiValuedTimestamp) o; return ComparisonChain.start() .compare(this.value1, that.value1) .compare(this.value2, that.value2) .result(); } MultiValuedTimestamp(T value1, U value2); @SuppressWarnings("unused") private  MultiValuedTimestamp(); @Override int compareTo(Timestamp o); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); T value1(); U value2();  }