@Test public void compareTo() { ShortOption a = new ShortOption(); ShortOption b = new ShortOption(); ShortOption c = new ShortOption(); ShortOption d = new ShortOption(); a.modify((short) -10); b.modify((short) 0); c.modify((short) 30); d.modify((short) -10); assertThat(compare(a, b), lessThan(0)); assertThat(compare(b, c), lessThan(0)); assertThat(compare(c, a), greaterThan(0)); assertThat(compare(a, c), lessThan(0)); assertThat(compare(b, a), greaterThan(0)); assertThat(compare(c, b), greaterThan(0)); assertThat(compare(a, d), is(0)); }
@Override public int compareTo(WritableRawComparable o) { ShortOption other = (ShortOption) o; if (nullValue | other.nullValue) { if (nullValue & other.nullValue) { return 0; } return nullValue ? -1 : +1; } return Short.compare(value, other.value); }
ShortOption extends ValueOption<ShortOption> { @Override public int compareTo(WritableRawComparable o) { ShortOption other = (ShortOption) o; if (nullValue | other.nullValue) { if (nullValue & other.nullValue) { return 0; } return nullValue ? -1 : +1; } return Short.compare(value, other.value); } }
ShortOption extends ValueOption<ShortOption> { @Override public int compareTo(WritableRawComparable o) { ShortOption other = (ShortOption) o; if (nullValue | other.nullValue) { if (nullValue & other.nullValue) { return 0; } return nullValue ? -1 : +1; } return Short.compare(value, other.value); } ShortOption();  ShortOption(short value); }
ShortOption extends ValueOption<ShortOption> { @Override public int compareTo(WritableRawComparable o) { ShortOption other = (ShortOption) o; if (nullValue | other.nullValue) { if (nullValue & other.nullValue) { return 0; } return nullValue ? -1 : +1; } return Short.compare(value, other.value); } ShortOption();  ShortOption(short value); short get(); short or(short alternate); @Deprecated ShortOption modify(short newValue); @Override @Deprecated void copyFrom(ShortOption optionOrNull); @Override int hashCode(); @Override boolean equals(Object obj); boolean has(int other); @Override int compareTo(WritableRawComparable o); @Override String toString(); @Override void write(DataOutput out); @SuppressWarnings("deprecation") @Override void readFields(DataInput in); @SuppressWarnings("deprecation") @Override int restore(byte[] bytes, int offset, int limit); @Override int getSizeInBytes(byte[] buf, int offset); @Override int compareInBytes(byte[] b1, int o1, byte[] b2, int o2); static int getBytesLength(byte[] bytes, int offset, int length); static int compareBytes(
            byte[] b1, int s1, int l1,
            byte[] b2, int s2, int l2); }
ShortOption extends ValueOption<ShortOption> { @Override public int compareTo(WritableRawComparable o) { ShortOption other = (ShortOption) o; if (nullValue | other.nullValue) { if (nullValue & other.nullValue) { return 0; } return nullValue ? -1 : +1; } return Short.compare(value, other.value); } ShortOption();  ShortOption(short value); short get(); short or(short alternate); @Deprecated ShortOption modify(short newValue); @Override @Deprecated void copyFrom(ShortOption optionOrNull); @Override int hashCode(); @Override boolean equals(Object obj); boolean has(int other); @Override int compareTo(WritableRawComparable o); @Override String toString(); @Override void write(DataOutput out); @SuppressWarnings("deprecation") @Override void readFields(DataInput in); @SuppressWarnings("deprecation") @Override int restore(byte[] bytes, int offset, int limit); @Override int getSizeInBytes(byte[] buf, int offset); @Override int compareInBytes(byte[] b1, int o1, byte[] b2, int o2); static int getBytesLength(byte[] bytes, int offset, int length); static int compareBytes(
            byte[] b1, int s1, int l1,
            byte[] b2, int s2, int l2);  }