Class TUnion<T extends TUnion<?,​?>,​F extends TFieldIdEnum>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<T>, TBase<T,​F>

    public abstract class TUnion<T extends TUnion<?,​?>,​F extends TFieldIdEnum>
    extends java.lang.Object
    implements TBase<T,​F>
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected F setField_  
      protected java.lang.Object value_  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TUnion()  
      protected TUnion​(F setField, java.lang.Object value)  
      protected TUnion​(TUnion<T,​F> other)  
    • Field Detail

      • value_

        protected java.lang.Object value_
    • Constructor Detail

      • TUnion

        protected TUnion()
      • TUnion

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

        protected TUnion​(TUnion<T,​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<T extends TUnion<?,​?>,​F extends TFieldIdEnum>
      • getFieldValue

        public java.lang.Object getFieldValue​(int fieldId)
      • 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<T extends TUnion<?,​?>,​F extends TFieldIdEnum>
      • isSet

        public boolean isSet​(int fieldId)
      • 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<T extends TUnion<?,​?>,​F extends TFieldIdEnum>
      • setFieldValue

        public void setFieldValue​(int fieldId,
                                  java.lang.Object value)
      • 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
      • standardSchemeReadValue

        protected abstract java.lang.Object standardSchemeReadValue​(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:
        read Object based on the field header, as specified by the argument.
        Throws:
        TException
      • tupleSchemeReadValue

        protected abstract java.lang.Object tupleSchemeReadValue​(TProtocol iprot,
                                                                 short fieldID)
                                                          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
      • 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.
        Specified by:
        clear in interface TBase<T extends TUnion<?,​?>,​F extends TFieldIdEnum>