public abstract class TUnion<T extends TUnion,F extends TFieldIdEnum> extends java.lang.Object implements TBase<T,F>
Modifier and Type | Field and Description |
---|---|
protected F |
setField_ |
protected java.lang.Object |
value_ |
Modifier | Constructor and Description |
---|---|
protected |
TUnion() |
protected |
TUnion(F setField,
java.lang.Object value) |
protected |
TUnion(TUnion<T,F> other) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
checkType(F setField,
java.lang.Object value)
Implementation should be generated so that we can efficiently type check
various values.
|
void |
clear()
Return to the state of having just been initialized, as though you had just
called the default constructor.
|
protected abstract F |
enumForId(short id) |
protected abstract TField |
getFieldDesc(F setField) |
java.lang.Object |
getFieldValue() |
java.lang.Object |
getFieldValue(F fieldId)
Get a field's value by field variable.
|
java.lang.Object |
getFieldValue(int fieldId) |
F |
getSetField() |
protected abstract TStruct |
getStructDesc() |
boolean |
isSet() |
boolean |
isSet(F fieldId)
Check if a field is currently set or unset.
|
boolean |
isSet(int fieldId) |
void |
read(TProtocol iprot)
Reads the TObject from the given input protocol.
|
protected abstract java.lang.Object |
readValue(TProtocol iprot,
TField field)
Implementation should be generated to read the right stuff from the wire
based on the field header.
|
void |
setFieldValue(F fieldId,
java.lang.Object value)
Set a field's value by field variable.
|
void |
setFieldValue(int fieldId,
java.lang.Object value) |
java.lang.String |
toString() |
void |
write(TProtocol oprot)
Writes the objects out to the protocol
|
protected abstract void |
writeValue(TProtocol oprot) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deepCopy, fieldForId
protected java.lang.Object value_
protected F extends TFieldIdEnum setField_
protected TUnion()
protected TUnion(F setField, java.lang.Object value)
public F getSetField()
public java.lang.Object getFieldValue()
public java.lang.Object getFieldValue(F fieldId)
TBase
getFieldValue
in interface TBase<T extends TUnion,F extends TFieldIdEnum>
public java.lang.Object getFieldValue(int fieldId)
public boolean isSet()
public boolean isSet(F fieldId)
TBase
public boolean isSet(int fieldId)
public void read(TProtocol iprot) throws TException
TBase
read
in interface TBase<T extends TUnion,F extends TFieldIdEnum>
iprot
- Input protocolTException
public void setFieldValue(F fieldId, java.lang.Object value)
TBase
setFieldValue
in interface TBase<T extends TUnion,F extends TFieldIdEnum>
public void setFieldValue(int fieldId, java.lang.Object value)
public void write(TProtocol oprot) throws TException
TBase
write
in interface TBase<T extends TUnion,F extends TFieldIdEnum>
oprot
- Output protocolTException
protected abstract void checkType(F setField, java.lang.Object value) throws java.lang.ClassCastException
setField
- value
- java.lang.ClassCastException
protected abstract java.lang.Object readValue(TProtocol iprot, TField field) throws TException
field
- TException
protected abstract void writeValue(TProtocol oprot) throws TException
TException
protected abstract TStruct getStructDesc()
protected abstract F enumForId(short id)
public java.lang.String toString()
toString
in class java.lang.Object