Package org.apache.thrift
Class TUnion<T extends TUnion<T,F>,F extends TFieldIdEnum>
java.lang.Object
org.apache.thrift.TUnion<T,F>
- All Implemented Interfaces:
Serializable
,Comparable<T>
,TBase<T,
,F> TSerializable
public abstract class TUnion<T extends TUnion<T,F>,F extends TFieldIdEnum>
extends Object
implements TBase<T,F>
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Implementation should be generated so that we can efficiently type check various values.final 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) getFieldValue
(int fieldId) getFieldValue
(F fieldId) Get a field's value by field variable.protected abstract TStruct
boolean
isSet()
boolean
isSet
(int fieldId) boolean
Check if a field is currently set or unset.void
Reads the TObject from the given input protocol.void
setFieldValue
(int fieldId, Object value) void
setFieldValue
(F fieldId, Object value) Set a field's value by field variable.protected abstract Object
standardSchemeReadValue
(TProtocol iprot, TField field) Implementation should be generated to read the right stuff from the wire based on the field header.protected abstract void
toString()
protected abstract Object
tupleSchemeReadValue
(TProtocol iprot, short fieldID) protected abstract void
tupleSchemeWriteValue
(TProtocol oprot) void
Writes the objects out to the protocolMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface org.apache.thrift.TBase
deepCopy, fieldForId
-
Field Details
-
value_
-
setField_
-
-
Constructor Details
-
TUnion
protected TUnion() -
TUnion
-
TUnion
-
-
Method Details
-
getSetField
-
getFieldValue
-
getFieldValue
Description copied from interface:TBase
Get a field's value by field variable. Primitive types will be wrapped in the appropriate "boxed" types.- Specified by:
getFieldValue
in interfaceTBase<T extends TUnion<T,
F>, F extends TFieldIdEnum> - Parameters:
fieldId
- the field whose value is requested.- Returns:
- the value of the requested field.
-
getFieldValue
-
isSet
public boolean isSet() -
isSet
Description copied from interface:TBase
Check if a field is currently set or unset. -
isSet
public boolean isSet(int fieldId) -
read
Description copied from interface:TSerializable
Reads the TObject from the given input protocol.- Specified by:
read
in interfaceTSerializable
- Parameters:
iprot
- Input protocol- Throws:
TException
- if there is an error reading from iprot
-
setFieldValue
Description copied from interface:TBase
Set a field's value by field variable. Primitive types must be "boxed" in the appropriate object wrapper type.- Specified by:
setFieldValue
in interfaceTBase<T extends TUnion<T,
F>, F extends TFieldIdEnum> - Parameters:
fieldId
- the field whose value is to be set.value
- the value to be assigned to field.
-
setFieldValue
-
write
Description copied from interface:TSerializable
Writes the objects out to the protocol- Specified by:
write
in interfaceTSerializable
- Parameters:
oprot
- Output protocol- Throws:
TException
- if there is an error writing to oprot
-
checkType
Implementation should be generated so that we can efficiently type check various values.- Parameters:
setField
- the field to assign value to.value
- the value to be assigned to setField.- Throws:
ClassCastException
- if the type of value is incompatible with the type of setField.
-
standardSchemeReadValue
Implementation should be generated to read the right stuff from the wire based on the field header.- Parameters:
iprot
- input protocol from which to read a value.field
- the field whose value is to be read from iprot.- Returns:
- read Object based on the field header, as specified by the argument.
- Throws:
TException
- on error during read.
-
standardSchemeWriteValue
- Throws:
TException
-
tupleSchemeReadValue
- Throws:
TException
-
tupleSchemeWriteValue
- Throws:
TException
-
getStructDesc
-
getFieldDesc
-
enumForId
-
toString
-
clear
public final void clear()Description copied from interface:TBase
Return to the state of having just been initialized, as though you had just called the default constructor.
-