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 booleancanEqual(Object obj)Returns true if the given object can be equaled with this object.booleanequals(Object obj)intgetArity()Gets the arity of this type - the number of fields without nesting.TypeInformation<?>[]getFieldTypes()Returns the field types.voidgetFlatFields(String fieldExpression, int offset, List<CompositeType.FlatFieldDescriptor> result)Computes the flat field descriptors for the given field expression with the given offset.intgetTotalFields()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.booleanhasDeterministicFieldOrder()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.inthashCode()booleanisBasicType()Checks if this type information represents a basic type.booleanisCaseClass()booleanisTupleType()Checks if this type information represents a Tuple type.StringtoString()-
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: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>- Returns:
- True, if this type information describes a basic type, false otherwise.
-
isTupleType
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>- Returns:
- True, if this type information describes a tuple type, false otherwise.
-
isCaseClass
public boolean isCaseClass()
-
getArity
public int getArity()
Description copied from class:TypeInformationGets the arity of this type - the number of fields without nesting.- Specified by:
getArityin 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: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>- 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:CompositeTypeComputes the flat field descriptors for the given field expression with the given offset.- Specified by:
getFlatFieldsin 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:CompositeTypeReturns the type of the (nested) field at the given field expression position. Wildcards are not allowed.- Specified by:
getTypeAtin 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:CompositeTypeReturns the type of the (unnested) field at the given field position.- Specified by:
getTypeAtin 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:
equalsin classCompositeType<T>
-
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.- Overrides:
canEqualin 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:
hashCodein classCompositeType<T>
-
toString
public String toString()
- Overrides:
toStringin classCompositeType<T>
-
hasDeterministicFieldOrder
public boolean hasDeterministicFieldOrder()
Description copied from class:CompositeTypeTrue 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:
hasDeterministicFieldOrderin classCompositeType<T>
-
-