@Test public void createFromObject() throws Exception { Union union = new WritableRawComparableUnion( new IntOption(100), new LongOption(200L), new StringOption("Hello, world!")); assertThat(union.switchObject(0), is((Object) new IntOption(100))); assertThat(union.switchObject(1), is((Object) new LongOption(200L))); assertThat(union.switchObject(2), is((Object) new StringOption("Hello, world!"))); }
@Override public Object switchObject(int newPosition) { this.position = newPosition; return getObject(); }
WritableRawComparableUnion implements Union, WritableRawComparable { @Override public Object switchObject(int newPosition) { this.position = newPosition; return getObject(); } }
WritableRawComparableUnion implements Union, WritableRawComparable { @Override public Object switchObject(int newPosition) { this.position = newPosition; return getObject(); } WritableRawComparableUnion(Class<?>... classes);  WritableRawComparableUnion(WritableRawComparable... objects); }
WritableRawComparableUnion implements Union, WritableRawComparable { @Override public Object switchObject(int newPosition) { this.position = newPosition; return getObject(); } WritableRawComparableUnion(Class<?>... classes);  WritableRawComparableUnion(WritableRawComparable... objects); @Override final int getPosition(); @Override Object switchObject(int newPosition); @Override final Object getObject(); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override int compareTo(WritableRawComparable o); @Override int getSizeInBytes(byte[] buf, int offset); @Override int compareInBytes(byte[] b1, int o1, byte[] b2, int o2); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
WritableRawComparableUnion implements Union, WritableRawComparable { @Override public Object switchObject(int newPosition) { this.position = newPosition; return getObject(); } WritableRawComparableUnion(Class<?>... classes);  WritableRawComparableUnion(WritableRawComparable... objects); @Override final int getPosition(); @Override Object switchObject(int newPosition); @Override final Object getObject(); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override int compareTo(WritableRawComparable o); @Override int getSizeInBytes(byte[] buf, int offset); @Override int compareInBytes(byte[] b1, int o1, byte[] b2, int o2); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }