Class ThriftField

java.lang.Object
org.apache.thrift.partial.ThriftField

public class ThriftField extends 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 Details

    • name

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

      public final 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 Details

    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

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

      public List<String> getFieldNames()
    • fromNames

      public static List<ThriftField> fromNames(Collection<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.