Class TupleTypeInfoBase<T>
- java.lang.Object
-
- org.apache.flink.api.common.typeinfo.TypeInformation<T>
-
- org.apache.flink.api.common.typeutils.CompositeType<T>
-
- org.apache.flink.api.java.typeutils.TupleTypeInfoBase<T>
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RowTypeInfo
,TupleTypeInfo
public abstract class TupleTypeInfoBase<T> extends CompositeType<T>
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.api.common.typeutils.CompositeType
CompositeType.FlatFieldDescriptor, CompositeType.InvalidFieldReferenceException, CompositeType.TypeComparatorBuilder<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected TypeInformation<?>[]
types
-
Constructor Summary
Constructors Constructor Description TupleTypeInfoBase(Class<T> tupleType, TypeInformation<?>... types)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canEqual(Object obj)
Returns true if the given object can be equaled with this object.boolean
equals(Object obj)
int
getArity()
Gets the arity of this type - the number of fields without nesting.TypeInformation<?>[]
getFieldTypes()
Returns the field types.void
getFlatFields(String fieldExpression, int offset, List<CompositeType.FlatFieldDescriptor> result)
Computes the flat field descriptors for the given field expression with the given offset.int
getTotalFields()
Gets the number of logical fields in this type.<X> TypeInformation<X>
getTypeAt(int pos)
Returns the type of the (unnested) field at the given field position.<X> TypeInformation<X>
getTypeAt(String fieldExpression)
Returns the type of the (nested) field at the given field expression position.boolean
hasDeterministicFieldOrder()
True if this type has an inherent ordering of the fields, such that a user can always be sure in which order the fields will be in.int
hashCode()
boolean
isBasicType()
Checks if this type information represents a basic type.boolean
isCaseClass()
boolean
isTupleType()
Checks if this type information represents a Tuple type.String
toString()
-
Methods inherited from class org.apache.flink.api.common.typeutils.CompositeType
createComparator, createTypeComparatorBuilder, getFieldIndex, getFieldNames, getFlatFields, getTypeClass, hasField, isKeyType, isSortKeyType
-
Methods inherited from class org.apache.flink.api.common.typeinfo.TypeInformation
createSerializer, getGenericParameters, of, of
-
-
-
-
Field Detail
-
types
protected final TypeInformation<?>[] types
-
-
Constructor Detail
-
TupleTypeInfoBase
public TupleTypeInfoBase(Class<T> tupleType, TypeInformation<?>... types)
-
-
Method Detail
-
isBasicType
public boolean isBasicType()
Description copied from class:TypeInformation
Checks if this type information represents a basic type. Basic types are defined inBasicTypeInfo
and are primitives, their boxing types, Strings, Date, Void, ...- Specified by:
isBasicType
in classTypeInformation<T>
- Returns:
- True, if this type information describes a basic type, false otherwise.
-
isTupleType
public boolean isTupleType()
Description copied from class:TypeInformation
Checks if this type information represents a Tuple type. Tuple types are subclasses of the Java API tuples.- Specified by:
isTupleType
in classTypeInformation<T>
- Returns:
- True, if this type information describes a tuple type, false otherwise.
-
isCaseClass
public boolean isCaseClass()
-
getArity
public int getArity()
Description copied from class:TypeInformation
Gets the arity of this type - the number of fields without nesting.- Specified by:
getArity
in classTypeInformation<T>
- Returns:
- Gets the number of fields in this type without nesting.
-
getFieldTypes
public TypeInformation<?>[] getFieldTypes()
Returns the field types.
-
getTotalFields
public int getTotalFields()
Description copied from class:TypeInformation
Gets 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:
getTotalFields
in classTypeInformation<T>
- Returns:
- The number of fields in this type, including its sub-fields (for composite types)
-
getFlatFields
public void getFlatFields(String fieldExpression, int offset, List<CompositeType.FlatFieldDescriptor> result)
Description copied from class:CompositeType
Computes the flat field descriptors for the given field expression with the given offset.- Specified by:
getFlatFields
in classCompositeType<T>
- Parameters:
fieldExpression
- The field expression for which the FlatFieldDescriptors are computed.offset
- The offset to use when computing the positions of the flat fields.result
- The list into which all flat field descriptors are inserted.
-
getTypeAt
public <X> TypeInformation<X> getTypeAt(String fieldExpression)
Description copied from class:CompositeType
Returns the type of the (nested) field at the given field expression position. Wildcards are not allowed.- Specified by:
getTypeAt
in classCompositeType<T>
- Parameters:
fieldExpression
- The field expression for which the field of which the type is returned.- Returns:
- The type of the field at the given field expression.
-
getTypeAt
public <X> TypeInformation<X> getTypeAt(int pos)
Description copied from class:CompositeType
Returns the type of the (unnested) field at the given field position.- Specified by:
getTypeAt
in classCompositeType<T>
- Parameters:
pos
- The position of the (unnested) field in this composite type.- Returns:
- The type of the field at the given position.
-
equals
public boolean equals(Object obj)
- Overrides:
equals
in classCompositeType<T>
-
canEqual
public boolean canEqual(Object obj)
Description copied from class:TypeInformation
Returns true if the given object can be equaled with this object. If not, it returns false.- Overrides:
canEqual
in classCompositeType<T>
- Parameters:
obj
- Object which wants to take part in the equality relation- Returns:
- true if obj can be equaled with this, otherwise false
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classCompositeType<T>
-
toString
public String toString()
- Overrides:
toString
in classCompositeType<T>
-
hasDeterministicFieldOrder
public boolean hasDeterministicFieldOrder()
Description copied from class:CompositeType
True if this type has an inherent ordering of the fields, such that a user can always be sure in which order the fields will be in. This is true for Tuples and Case Classes. It is not true for Regular Java Objects, since there, the ordering of the fields can be arbitrary.This is used when translating a DataSet or DataStream to an Expression Table, when initially renaming the fields of the underlying type.
- Overrides:
hasDeterministicFieldOrder
in classCompositeType<T>
-
-