Class SimpleTypeInformation<T>

  • Type Parameters:
    T - Java type we represent.
    All Implemented Interfaces:
    TypeInformation
    Direct Known Subclasses:
    VectorTypeInformation

    public class SimpleTypeInformation<T>
    extends java.lang.Object
    implements TypeInformation
    Class wrapping a particular data type.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • cls

        private java.lang.Class<? super T> cls
        The restriction class we represent.
      • label

        private java.lang.String label
        Type label.
    • Constructor Detail

      • SimpleTypeInformation

        public SimpleTypeInformation​(java.lang.Class<? super T> cls)
        Constructor.
        Parameters:
        cls - restriction class
      • SimpleTypeInformation

        public SimpleTypeInformation​(java.lang.Class<? super T> cls,
                                     java.lang.String label)
        Constructor.
        Parameters:
        cls - restriction class
        label - type label
      • SimpleTypeInformation

        public SimpleTypeInformation​(java.lang.Class<? super T> cls,
                                     ByteBufferSerializer<? super T> serializer)
        Constructor.
        Parameters:
        cls - restriction class
        serializer - Serializer
      • SimpleTypeInformation

        public SimpleTypeInformation​(java.lang.Class<? super T> cls,
                                     java.lang.String label,
                                     ByteBufferSerializer<? super T> serializer)
        Constructor.
        Parameters:
        cls - restriction class
        label - type label
        serializer - Serializer
    • Method Detail

      • getRestrictionClass

        public final java.lang.Class<? super T> getRestrictionClass()
        Get the raw restriction class.
        Returns:
        Restriction class
      • isAssignableFromType

        public boolean isAssignableFromType​(TypeInformation type)
        Description copied from interface: TypeInformation
        Test whether this type is assignable from another type.
        Specified by:
        isAssignableFromType in interface TypeInformation
        Parameters:
        type - Other type
        Returns:
        true when the other type is accepted as subtype.
      • isAssignableFrom

        public boolean isAssignableFrom​(java.lang.Object other)
        Description copied from interface: TypeInformation
        Test whether this type is assignable from a given object instance.
        Specified by:
        isAssignableFrom in interface TypeInformation
        Parameters:
        other - Other object
        Returns:
        true when the other type is an acceptable instance.
      • cast

        public T cast​(java.lang.Object other)
        Cast the object to type T (actually to the given restriction class!).
        Parameters:
        other - Object to cast.
        Returns:
        Instance
      • toString

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

        public java.lang.String getLabel()
        Get the type label.
        Returns:
        Label
      • getSerializer

        public ByteBufferSerializer<? super T> getSerializer()
        Get the serializer for this type.
        Returns:
        Type serializer
      • setSerializer

        public void setSerializer​(ByteBufferSerializer<? super T> serializer)
        Set the serializer for this type.
        Parameters:
        serializer - Serializer to use