Class ThriftField


  • public class ThriftField
    extends java.lang.Object
    Holds name of a thrift field and of its sub-fields recursively.

    This class is meant to be used in conjunction with TDeserializer.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.List<ThriftField> fields
      List of sub-fields of this field.
      java.lang.String name
      Name of this field as it appears in a thrift file.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      static java.util.List<ThriftField> fromNames​(java.util.Collection<java.lang.String> fieldNames)
      Generates and returns n-ary tree of fields and their sub-fields.
      java.util.List<java.lang.String> getFieldNames()  
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • name

        public final java.lang.String name
        Name of this field as it appears in a thrift file. Case sensitive.
      • fields

        public final java.util.List<ThriftField> fields
        List of sub-fields of this field. This list should have only those sub-fields that need to be deserialized by the TDeserializer.
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

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

        public java.util.List<java.lang.String> getFieldNames()
      • fromNames

        public static java.util.List<ThriftField> fromNames​(java.util.Collection<java.lang.String> fieldNames)
        Generates and returns n-ary tree of fields and their sub-fields.

        Parameters:
        fieldNames - collection of fully qualified field names. for example, In case of PinJoin thrift struct, the following are valid field names -- signature -- pins.user.userId -- textSignal.termSignal.termDataMap
        Returns:
        n-ary tree of fields and their sub-fields.