L
- the Left value typeR
- the Right value type@Public public class EitherTypeInfo<L,R> extends TypeInformation<Either<L,R>>
TypeInformation
for the Either
type of the Java API.Constructor and Description |
---|
EitherTypeInfo(TypeInformation<L> leftType,
TypeInformation<R> rightType) |
Modifier and Type | Method and Description |
---|---|
boolean |
canEqual(Object obj)
Returns true if the given object can be equaled with this object.
|
TypeSerializer<Either<L,R>> |
createSerializer(ExecutionConfig config)
Creates a serializer for the type.
|
boolean |
equals(Object obj) |
int |
getArity()
Gets the arity of this type - the number of fields without nesting.
|
Map<String,TypeInformation<?>> |
getGenericParameters()
Optional method for giving Flink's type extraction system information about the mapping of a
generic type parameter to the type information of a subtype.
|
TypeInformation<L> |
getLeftType() |
TypeInformation<R> |
getRightType() |
int |
getTotalFields()
Gets the number of logical fields in this type.
|
Class<Either<L,R>> |
getTypeClass()
Gets the class of the type represented by this type information.
|
int |
hashCode() |
boolean |
isBasicType()
Checks if this type information represents a basic type.
|
boolean |
isKeyType()
Checks whether this type can be used as a key.
|
boolean |
isTupleType()
Checks if this type information represents a Tuple type.
|
String |
toString() |
isSortKeyType, of, of
@PublicEvolving public EitherTypeInfo(TypeInformation<L> leftType, TypeInformation<R> rightType)
@PublicEvolving public boolean isBasicType()
TypeInformation
BasicTypeInfo
and are primitives, their boxing types, Strings, Date, Void, ...isBasicType
in class TypeInformation<Either<L,R>>
@PublicEvolving public boolean isTupleType()
TypeInformation
isTupleType
in class TypeInformation<Either<L,R>>
@PublicEvolving public int getArity()
TypeInformation
getArity
in class TypeInformation<Either<L,R>>
@PublicEvolving public int getTotalFields()
TypeInformation
The total number of fields must be at least 1.
getTotalFields
in class TypeInformation<Either<L,R>>
@PublicEvolving public Class<Either<L,R>> getTypeClass()
TypeInformation
getTypeClass
in class TypeInformation<Either<L,R>>
@PublicEvolving public Map<String,TypeInformation<?>> getGenericParameters()
TypeInformation
For instance, a method for a Tuple2
would look like this:
Map m = new HashMap();
m.put("T0", this.getTypeAt(0));
m.put("T1", this.getTypeAt(1));
return m;
getGenericParameters
in class TypeInformation<Either<L,R>>
@PublicEvolving public boolean isKeyType()
TypeInformation
isKeyType
in class TypeInformation<Either<L,R>>
@PublicEvolving public TypeSerializer<Either<L,R>> createSerializer(ExecutionConfig config)
TypeInformation
createSerializer
in class TypeInformation<Either<L,R>>
config
- The config used to parameterize the serializer.public int hashCode()
hashCode
in class TypeInformation<Either<L,R>>
public boolean canEqual(Object obj)
TypeInformation
canEqual
in class TypeInformation<Either<L,R>>
obj
- Object which wants to take part in the equality relationpublic TypeInformation<L> getLeftType()
public TypeInformation<R> getRightType()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.