org.apache.thrift
Class TUnion<F extends TFieldIdEnum>

java.lang.Object
  extended by org.apache.thrift.TUnion<F>
All Implemented Interfaces:
java.io.Serializable, TBase<F>

public abstract class TUnion<F extends TFieldIdEnum>
extends java.lang.Object
implements TBase<F>

See Also:
Serialized Form

Field Summary
protected  F setField_
           
protected  java.lang.Object value_
           
 
Constructor Summary
protected TUnion()
           
protected TUnion(F setField, java.lang.Object value)
           
protected TUnion(TUnion<F> other)
           
 
Method Summary
protected abstract  void checkType(F setField, java.lang.Object value)
          Implementation should be generated so that we can efficiently type check various values.
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)
          Get a field's value by id.
 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)
          Check if a field is currently set or unset.
 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)
          Set a field's value by id.
 java.lang.String toString()
           
 void write(TProtocol oprot)
          Writes the objects out to the protocol
protected abstract  void writeValue(TProtocol oprot, F setField, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.thrift.TBase
deepCopy
 

Field Detail

value_

protected java.lang.Object value_

setField_

protected F extends TFieldIdEnum setField_
Constructor Detail

TUnion

protected TUnion()

TUnion

protected TUnion(F setField,
                 java.lang.Object value)

TUnion

protected TUnion(TUnion<F> other)
Method Detail

getSetField

public F getSetField()

getFieldValue

public java.lang.Object getFieldValue()

getFieldValue

public java.lang.Object getFieldValue(F fieldId)
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 interface TBase<F extends TFieldIdEnum>

getFieldValue

public java.lang.Object getFieldValue(int fieldId)
Description copied from interface: TBase
Get a field's value by id. Primitive types will be wrapped in the appropriate "boxed" types.

Specified by:
getFieldValue in interface TBase<F extends TFieldIdEnum>
Parameters:
fieldId - The field's id tag as found in the IDL.

isSet

public boolean isSet()

isSet

public boolean isSet(F fieldId)
Description copied from interface: TBase
Check if a field is currently set or unset.

Specified by:
isSet in interface TBase<F extends TFieldIdEnum>

isSet

public boolean isSet(int fieldId)
Description copied from interface: TBase
Check if a field is currently set or unset.

Specified by:
isSet in interface TBase<F extends TFieldIdEnum>
Parameters:
fieldId - The field's id tag as found in the IDL.

read

public void read(TProtocol iprot)
          throws TException
Description copied from interface: TBase
Reads the TObject from the given input protocol.

Specified by:
read in interface TBase<F extends TFieldIdEnum>
Parameters:
iprot - Input protocol
Throws:
TException

setFieldValue

public void setFieldValue(F fieldId,
                          java.lang.Object value)
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 interface TBase<F extends TFieldIdEnum>

setFieldValue

public void setFieldValue(int fieldId,
                          java.lang.Object value)
Description copied from interface: TBase
Set a field's value by id. Primitive types must be "boxed" in the appropriate object wrapper type.

Specified by:
setFieldValue in interface TBase<F extends TFieldIdEnum>
Parameters:
fieldId - The field's id tag as found in the IDL.

write

public void write(TProtocol oprot)
           throws TException
Description copied from interface: TBase
Writes the objects out to the protocol

Specified by:
write in interface TBase<F extends TFieldIdEnum>
Parameters:
oprot - Output protocol
Throws:
TException

checkType

protected abstract void checkType(F setField,
                                  java.lang.Object value)
                           throws java.lang.ClassCastException
Implementation should be generated so that we can efficiently type check various values.

Parameters:
setField -
value -
Throws:
java.lang.ClassCastException

readValue

protected abstract java.lang.Object readValue(TProtocol iprot,
                                              TField field)
                                       throws TException
Implementation should be generated to read the right stuff from the wire based on the field header.

Parameters:
field -
Returns:
Throws:
TException

writeValue

protected abstract void writeValue(TProtocol oprot,
                                   F setField,
                                   java.lang.Object value)
                            throws TException
Throws:
TException

getStructDesc

protected abstract TStruct getStructDesc()

getFieldDesc

protected abstract TField getFieldDesc(F setField)

enumForId

protected abstract F enumForId(short id)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object