Class ValueTypeInfo<T extends Value>
- java.lang.Object
-
- org.apache.flink.api.common.typeinfo.TypeInformation<T>
-
- org.apache.flink.api.java.typeutils.ValueTypeInfo<T>
-
- Type Parameters:
T- The type of the class represented by this type information.
- All Implemented Interfaces:
Serializable,AtomicType<T>
@Public public class ValueTypeInfo<T extends Value> extends TypeInformation<T> implements AtomicType<T>
Type information for data types that extend theValueinterface. The value interface allows types to define their custom serialization and deserialization routines.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ValueTypeInfo<BooleanValue>BOOLEAN_VALUE_TYPE_INFOstatic ValueTypeInfo<ByteValue>BYTE_VALUE_TYPE_INFOstatic ValueTypeInfo<CharValue>CHAR_VALUE_TYPE_INFOstatic ValueTypeInfo<DoubleValue>DOUBLE_VALUE_TYPE_INFOstatic ValueTypeInfo<FloatValue>FLOAT_VALUE_TYPE_INFOstatic ValueTypeInfo<IntValue>INT_VALUE_TYPE_INFOstatic ValueTypeInfo<LongValue>LONG_VALUE_TYPE_INFOstatic ValueTypeInfo<NullValue>NULL_VALUE_TYPE_INFOstatic ValueTypeInfo<ShortValue>SHORT_VALUE_TYPE_INFOstatic ValueTypeInfo<StringValue>STRING_VALUE_TYPE_INFO
-
Constructor Summary
Constructors Constructor Description ValueTypeInfo(Class<T> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancanEqual(Object obj)Returns true if the given object can be equaled with this object.TypeComparator<T>createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig)Creates a comparator for this type.TypeSerializer<T>createSerializer(ExecutionConfig config)Deprecated.TypeSerializer<T>createSerializer(SerializerConfig serializerConfig)Creates a serializer for the type.booleanequals(Object obj)intgetArity()Gets the arity of this type - the number of fields without nesting.intgetTotalFields()Gets the number of logical fields in this type.Class<T>getTypeClass()Gets the class of the type represented by this type information.inthashCode()booleanisBasicType()Checks if this type information represents a basic type.booleanisBasicValueType()booleanisKeyType()Checks whether this type can be used as a key.booleanisTupleType()Checks if this type information represents a Tuple type.StringtoString()-
Methods inherited from class org.apache.flink.api.common.typeinfo.TypeInformation
getGenericParameters, isSortKeyType, of, of
-
-
-
-
Field Detail
-
BOOLEAN_VALUE_TYPE_INFO
public static final ValueTypeInfo<BooleanValue> BOOLEAN_VALUE_TYPE_INFO
-
BYTE_VALUE_TYPE_INFO
public static final ValueTypeInfo<ByteValue> BYTE_VALUE_TYPE_INFO
-
CHAR_VALUE_TYPE_INFO
public static final ValueTypeInfo<CharValue> CHAR_VALUE_TYPE_INFO
-
DOUBLE_VALUE_TYPE_INFO
public static final ValueTypeInfo<DoubleValue> DOUBLE_VALUE_TYPE_INFO
-
FLOAT_VALUE_TYPE_INFO
public static final ValueTypeInfo<FloatValue> FLOAT_VALUE_TYPE_INFO
-
INT_VALUE_TYPE_INFO
public static final ValueTypeInfo<IntValue> INT_VALUE_TYPE_INFO
-
LONG_VALUE_TYPE_INFO
public static final ValueTypeInfo<LongValue> LONG_VALUE_TYPE_INFO
-
NULL_VALUE_TYPE_INFO
public static final ValueTypeInfo<NullValue> NULL_VALUE_TYPE_INFO
-
SHORT_VALUE_TYPE_INFO
public static final ValueTypeInfo<ShortValue> SHORT_VALUE_TYPE_INFO
-
STRING_VALUE_TYPE_INFO
public static final ValueTypeInfo<StringValue> STRING_VALUE_TYPE_INFO
-
-
Method Detail
-
getArity
@PublicEvolving public int getArity()
Description copied from class:TypeInformationGets the arity of this type - the number of fields without nesting.- Specified by:
getArityin classTypeInformation<T extends Value>- Returns:
- Gets the number of fields in this type without nesting.
-
getTotalFields
@PublicEvolving public int getTotalFields()
Description copied from class:TypeInformationGets the number of logical fields in this type. This includes its nested and transitively nested fields, in the case of composite types. In the example above, the OuterType type has three fields in total.The total number of fields must be at least 1.
- Specified by:
getTotalFieldsin classTypeInformation<T extends Value>- Returns:
- The number of fields in this type, including its sub-fields (for composite types)
-
getTypeClass
@PublicEvolving public Class<T> getTypeClass()
Description copied from class:TypeInformationGets the class of the type represented by this type information.- Specified by:
getTypeClassin classTypeInformation<T extends Value>- Returns:
- The class of the type represented by this type information.
-
isBasicType
@PublicEvolving public boolean isBasicType()
Description copied from class:TypeInformationChecks if this type information represents a basic type. Basic types are defined inBasicTypeInfoand are primitives, their boxing types, Strings, Date, Void, ...- Specified by:
isBasicTypein classTypeInformation<T extends Value>- Returns:
- True, if this type information describes a basic type, false otherwise.
-
isBasicValueType
@PublicEvolving public boolean isBasicValueType()
-
isTupleType
@PublicEvolving public boolean isTupleType()
Description copied from class:TypeInformationChecks if this type information represents a Tuple type. Tuple types are subclasses of the Java API tuples.- Specified by:
isTupleTypein classTypeInformation<T extends Value>- Returns:
- True, if this type information describes a tuple type, false otherwise.
-
isKeyType
@PublicEvolving public boolean isKeyType()
Description copied from class:TypeInformationChecks whether this type can be used as a key. As a bare minimum, types have to be hashable and comparable to be keys.- Specified by:
isKeyTypein classTypeInformation<T extends Value>- Returns:
- True, if the type can be used as a key, false otherwise.
-
createSerializer
public TypeSerializer<T> createSerializer(SerializerConfig serializerConfig)
Description copied from class:TypeInformationCreates a serializer for the type. The serializer may use the ExecutionConfig for parameterization.- Overrides:
createSerializerin classTypeInformation<T extends Value>- Parameters:
serializerConfig- The config used to parameterize the serializer.- Returns:
- A serializer for this type.
-
createSerializer
@Deprecated public TypeSerializer<T> createSerializer(ExecutionConfig config)
Deprecated.Description copied from class:TypeInformationCreateTypeSerializerfor this type.- Specified by:
createSerializerin classTypeInformation<T extends Value>- Parameters:
config- the configuration of this job execution
-
createComparator
@PublicEvolving public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig)
Description copied from interface:AtomicTypeCreates a comparator for this type.- Specified by:
createComparatorin interfaceAtomicType<T extends Value>- Parameters:
sortOrderAscending- True, if the comparator should define the order to be ascending, false, if the comparator should define the order to be descending.executionConfig- The config from which the comparator will be parametrized. Parametrization includes for example registration of class tags for frameworks like Kryo.- Returns:
- A comparator for this type.
-
hashCode
public int hashCode()
- Specified by:
hashCodein classTypeInformation<T extends Value>
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin classTypeInformation<T extends Value>
-
canEqual
public boolean canEqual(Object obj)
Description copied from class:TypeInformationReturns true if the given object can be equaled with this object. If not, it returns false.- Specified by:
canEqualin classTypeInformation<T extends Value>- Parameters:
obj- Object which wants to take part in the equality relation- Returns:
- true if obj can be equaled with this, otherwise false
-
toString
public String toString()
- Specified by:
toStringin classTypeInformation<T extends Value>
-
-