Class FieldMetaData

  • All Implemented Interfaces:
    java.io.Serializable

    public class FieldMetaData
    extends java.lang.Object
    implements java.io.Serializable
    This class is used to store meta data about thrift fields. Every field in a a struct should have a corresponding instance of this class describing it. The meta data is registered by ALL Thrift struct classes via a static {...} initializer block in the generated Thrift code. Since different threads could be initializing different Thrift classes, calls to the public static methods of this class could be racy. All methods of this class should be made thread safe.
    See Also:
    Serialized Form
    • Field Detail

      • fieldName

        public final java.lang.String fieldName
      • requirementType

        public final byte requirementType
    • Constructor Detail

      • FieldMetaData

        public FieldMetaData​(java.lang.String name,
                             byte req,
                             FieldValueMetaData vMetaData)
    • Method Detail

      • addStructMetaDataMap

        public static void addStructMetaDataMap​(java.lang.Class<? extends TBase> sClass,
                                                java.util.Map<? extends TFieldIdEnum,​FieldMetaData> map)
      • getStructMetaDataMap

        public static java.util.Map<? extends TFieldIdEnum,​FieldMetaData> getStructMetaDataMap​(java.lang.Class<? extends TBase> sClass)
        Returns a map with metadata (i.e. instances of FieldMetaData) that describe the fields of the given class.
        Parameters:
        sClass - The TBase class for which the metadata map is requested. It is not guaranteed that sClass will have been statically initialized before this method is called. A racy call to addStructMetaDataMap(Class, Map) from a different thread during static initialization of the Thrift class is possible.