Package org.apache.thrift.partial
Class ThriftField
- java.lang.Object
-
- org.apache.thrift.partial.ThriftField
-
public class ThriftField extends java.lang.ObjectHolds 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>fieldsList of sub-fields of this field.java.lang.StringnameName 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 booleanequals(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()inthashCode()java.lang.StringtoString()
-
-
-
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 theTDeserializer.
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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.
-
-