TObject implements
        org.apache.thrift.TBase<TObject, TObject._Fields>,
        java.io.Serializable,
        Cloneable,
        Comparable<TObject> { @Override public int compareTo(TObject other) { return comparator().compare(this, other); } TObject();  TObject(ByteBuffer data, Type type);  TObject(TObject other); static Comparator<TObject> comparator(); static Aliases alias(Operator operator, TObject... values); ByteBuffer bufferForData(); @DoNotInvoke TObject cacheServerWrapper(Object serverValue); @Override void clear(); @Override int compareTo(TObject other); int compareToIgnoreCase(TObject other); TObject deepCopy(); @Override boolean equals(Object obj); _Fields fieldForId(int fieldId); byte[] getData(); Object getFieldValue(_Fields field); @Nullable Object getJavaFormat(); @Nullable @DoNotInvoke Object getServerWrapper(); Type getType(); @Override int hashCode(); boolean is(Operator operator, TObject... values); boolean isBlank(); boolean isCharSequenceType(); boolean isIgnoreCase(Operator operator, TObject... values); boolean isSet(_Fields field); boolean isSetData(); boolean isSetType(); boolean matches(TObject other); void read(org.apache.thrift.protocol.TProtocol iprot); TObject setData(byte[] data); TObject setData(ByteBuffer data); void setDataIsSet(boolean value); void setFieldValue(_Fields field, Object value); TObject setJavaFormat(Object java); TObject setType(Type type); void setTypeIsSet(boolean value); @Override String toString(); void unsetData(); void unsetType(); void validate(); void write(org.apache.thrift.protocol.TProtocol oprot); static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static final TObject NEGATIVE_INFINITY; static final TObject NULL; static final TObject POSITIVE_INFINITY; public ByteBuffer data; public Type type; }
@Test public void testCompareTo() { TObject big = Convert.javaToThrift(1564359884275001L); TObject small = Convert.javaToThrift(1564359884211000L); Assert.assertTrue(big.compareTo(small) > 0); Assert.assertTrue(small.compareTo(big) < 0); }
@Test public void testCompareToVsEqualsConsistency() { TObject a1 = Convert.javaToThrift("a"); TObject a2 = Convert.javaToThrift("A"); Assert.assertNotEquals(a1, a2); Assert.assertNotEquals(0, a1.compareTo(a2)); }