Class TypeData<T>

  • Type Parameters:
    T - the underlying type being represented
    All Implemented Interfaces:
    org.bson.codecs.pojo.TypeWithTypeParameters<T>
    Direct Known Subclasses:
    WildCardTypeData

    public class TypeData<T>
    extends Object
    implements org.bson.codecs.pojo.TypeWithTypeParameters<T>
    Holds type information about a type element
    Since:
    2.0
    Developer note.
    This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • builder

        public static <T> TypeData.Builder<T> builder​(Class<T> type)
        Creates a new builder for ClassTypeData
        Type Parameters:
        T - the type
        Parameters:
        type - the class for the type
        Returns:
        the builder
      • newInstance

        public static TypeData<?> newInstance​(Field field)
        Creates a TypeData reflecting the type of the given field.
        Parameters:
        field - the field to analyze
        Returns:
        the new TypeData information
      • newInstance

        public static <T> TypeData<T> newInstance​(Type genericType,
                                                  Class<T> clazz)
        Creates a TypeData reflecting the given generic type and class.
        Type Parameters:
        T - the type of the new TypeData instance
        Parameters:
        genericType - the type to analyze
        clazz - the class to analyze
        Returns:
        the new TypeData information
      • getType

        public Class<T> getType()
        Specified by:
        getType in interface org.bson.codecs.pojo.TypeWithTypeParameters<T>
        Returns:
        the class this ClassTypeData represents
      • getTypeParameters

        public List<TypeData<?>> getTypeParameters()
        Specified by:
        getTypeParameters in interface org.bson.codecs.pojo.TypeWithTypeParameters<T>
        Returns:
        the type parameters for the class
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object