@Public public class TypeExtractor extends Object
| Modifier and Type | Field and Description |
|---|---|
static int[] |
NO_INDEX |
| Modifier | Constructor and Description |
|---|---|
protected |
TypeExtractor() |
| Modifier and Type | Method and Description |
|---|---|
protected <OUT,IN1,IN2> |
analyzePojo(Class<OUT> clazz,
ArrayList<Type> typeHierarchy,
ParameterizedType parameterizedType,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <T> TypeInformation<T> |
createHadoopWritableTypeInfo(Class<T> clazz) |
static <IN1,IN2,OUT> |
createTypeInfo(Class<?> baseClass,
Class<?> clazz,
int returnParamPos,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <T> TypeInformation<T> |
createTypeInfo(Class<T> type) |
static <OUT> TypeInformation<OUT> |
createTypeInfo(Object instance,
Class<?> baseClass,
Class<?> clazz,
int returnParamPos)
Creates a
TypeInformation from the given parameters. |
static TypeInformation<?> |
createTypeInfo(Type t) |
static <IN,ACC> TypeInformation<ACC> |
getAggregateFunctionAccumulatorType(AggregateFunction<IN,ACC,?> function,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getAggregateFunctionReturnType(AggregateFunction<IN,?,OUT> function,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static List<Field> |
getAllDeclaredFields(Class<?> clazz,
boolean ignoreDuplicates)
Recursively determine all declared fields
This is required because class.getFields() is not returning fields defined
in parent classes.
|
static <IN1,IN2,OUT> |
getBinaryOperatorReturnType(Function function,
Class<?> baseClass,
int input1TypeArgumentIndex,
int input2TypeArgumentIndex,
int outputTypeArgumentIndex,
int[] lambdaInput1TypeArgumentIndices,
int[] lambdaInput2TypeArgumentIndices,
int[] lambdaOutputTypeArgumentIndices,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing)
Returns the binary operator's return type.
|
static <IN1,IN2,OUT> |
getCoGroupReturnTypes(CoGroupFunction<IN1,IN2,OUT> coGroupInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <IN1,IN2,OUT> |
getCoGroupReturnTypes(CoGroupFunction<IN1,IN2,OUT> coGroupInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing) |
static <IN1,IN2,OUT> |
getCrossReturnTypes(CrossFunction<IN1,IN2,OUT> crossInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <IN1,IN2,OUT> |
getCrossReturnTypes(CrossFunction<IN1,IN2,OUT> crossInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing) |
static Field |
getDeclaredField(Class<?> clazz,
String name) |
static <IN1,IN2,OUT> |
getFlatJoinReturnTypes(FlatJoinFunction<IN1,IN2,OUT> joinInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <IN1,IN2,OUT> |
getFlatJoinReturnTypes(FlatJoinFunction<IN1,IN2,OUT> joinInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getFlatMapReturnTypes(FlatMapFunction<IN,OUT> flatMapInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getFlatMapReturnTypes(FlatMapFunction<IN,OUT> flatMapInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface,
TypeInformation<IN> inType)
Deprecated.
will be removed in a future version
|
static <IN,OUT> TypeInformation<OUT> |
getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing)
Deprecated.
will be removed in a future version
|
static <X> TypeInformation<X> |
getForClass(Class<X> clazz)
Creates type information from a given Class such as Integer, String[] or POJOs.
|
static <X> TypeInformation<X> |
getForObject(X value) |
static <IN,OUT> TypeInformation<OUT> |
getGroupCombineReturnTypes(GroupCombineFunction<IN,OUT> combineInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getGroupCombineReturnTypes(GroupCombineFunction<IN,OUT> combineInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getGroupReduceReturnTypes(GroupReduceFunction<IN,OUT> groupReduceInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getGroupReduceReturnTypes(GroupReduceFunction<IN,OUT> groupReduceInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN> TypeInformation<IN> |
getInputFormatTypes(InputFormat<IN,?> inputFormatInterface) |
static <IN1,IN2,OUT> |
getJoinReturnTypes(JoinFunction<IN1,IN2,OUT> joinInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type) |
static <IN1,IN2,OUT> |
getJoinReturnTypes(JoinFunction<IN1,IN2,OUT> joinInterface,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getKeySelectorTypes(KeySelector<IN,OUT> selectorInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getKeySelectorTypes(KeySelector<IN,OUT> selectorInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getMapPartitionReturnTypes(MapPartitionFunction<IN,OUT> mapPartitionInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getMapPartitionReturnTypes(MapPartitionFunction<IN,OUT> mapPartitionInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static <IN,OUT> TypeInformation<OUT> |
getMapReturnTypes(MapFunction<IN,OUT> mapInterface,
TypeInformation<IN> inType) |
static <IN,OUT> TypeInformation<OUT> |
getMapReturnTypes(MapFunction<IN,OUT> mapInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
static Type |
getParameterType(Class<?> baseClass,
Class<?> clazz,
int pos) |
static <T> TypeInformation<T> |
getPartitionerTypes(Partitioner<T> partitioner) |
static <T> TypeInformation<T> |
getPartitionerTypes(Partitioner<T> partitioner,
String functionName,
boolean allowMissing) |
static <OUT> TypeInfoFactory<OUT> |
getTypeInfoFactory(Type t)
Returns the type information factory for a type using the factory registry or annotations.
|
static <IN,OUT> TypeInformation<OUT> |
getUnaryOperatorReturnType(Function function,
Class<?> baseClass,
int inputTypeArgumentIndex,
int outputTypeArgumentIndex,
int[] lambdaInputTypeArgumentIndices,
int[] lambdaOutputTypeArgumentIndices,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing)
Returns the unary operator's return type.
|
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getMapReturnTypes(MapFunction<IN,OUT> mapInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getMapReturnTypes(MapFunction<IN,OUT> mapInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getFlatMapReturnTypes(FlatMapFunction<IN,OUT> flatMapInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getFlatMapReturnTypes(FlatMapFunction<IN,OUT> flatMapInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving @Deprecated public static <IN,OUT> TypeInformation<OUT> getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface, TypeInformation<IN> inType)
@PublicEvolving @Deprecated public static <IN,OUT> TypeInformation<OUT> getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,ACC> TypeInformation<ACC> getAggregateFunctionAccumulatorType(AggregateFunction<IN,ACC,?> function, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getAggregateFunctionReturnType(AggregateFunction<IN,?,OUT> function, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getMapPartitionReturnTypes(MapPartitionFunction<IN,OUT> mapPartitionInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getMapPartitionReturnTypes(MapPartitionFunction<IN,OUT> mapPartitionInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getGroupReduceReturnTypes(GroupReduceFunction<IN,OUT> groupReduceInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getGroupReduceReturnTypes(GroupReduceFunction<IN,OUT> groupReduceInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getGroupCombineReturnTypes(GroupCombineFunction<IN,OUT> combineInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getGroupCombineReturnTypes(GroupCombineFunction<IN,OUT> combineInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getFlatJoinReturnTypes(FlatJoinFunction<IN1,IN2,OUT> joinInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getFlatJoinReturnTypes(FlatJoinFunction<IN1,IN2,OUT> joinInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getJoinReturnTypes(JoinFunction<IN1,IN2,OUT> joinInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getJoinReturnTypes(JoinFunction<IN1,IN2,OUT> joinInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getCoGroupReturnTypes(CoGroupFunction<IN1,IN2,OUT> coGroupInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getCoGroupReturnTypes(CoGroupFunction<IN1,IN2,OUT> coGroupInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getCrossReturnTypes(CrossFunction<IN1,IN2,OUT> crossInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getCrossReturnTypes(CrossFunction<IN1,IN2,OUT> crossInterface, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getKeySelectorTypes(KeySelector<IN,OUT> selectorInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getKeySelectorTypes(KeySelector<IN,OUT> selectorInterface, TypeInformation<IN> inType, String functionName, boolean allowMissing)
@PublicEvolving public static <T> TypeInformation<T> getPartitionerTypes(Partitioner<T> partitioner)
@PublicEvolving public static <T> TypeInformation<T> getPartitionerTypes(Partitioner<T> partitioner, String functionName, boolean allowMissing)
@PublicEvolving public static <IN> TypeInformation<IN> getInputFormatTypes(InputFormat<IN,?> inputFormatInterface)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getUnaryOperatorReturnType(Function function, Class<?> baseClass, int inputTypeArgumentIndex, int outputTypeArgumentIndex, int[] lambdaInputTypeArgumentIndices, int[] lambdaOutputTypeArgumentIndices, TypeInformation<IN> inType, String functionName, boolean allowMissing)
NOTE: lambda type indices allow extraction of Type from lambdas. To extract input type IN
from the function given below one should pass new int[] {0,1,0} as lambdaInputTypeArgumentIndices.
OUT apply(Map> value)
IN - Input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functioninputTypeArgumentIndex - Index of input type in the class specificationoutputTypeArgumentIndex - Index of output type in the class specificationlambdaInputTypeArgumentIndices - Table of indices of the type argument specifying the input type. See example.lambdaOutputTypeArgumentIndices - Table of indices of the type argument specifying the input type. See example.inType - Type of the input elements (In case of an iterable, it is the element type)functionName - Function nameallowMissing - Can the type information be missing@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getBinaryOperatorReturnType(Function function, Class<?> baseClass, int input1TypeArgumentIndex, int input2TypeArgumentIndex, int outputTypeArgumentIndex, int[] lambdaInput1TypeArgumentIndices, int[] lambdaInput2TypeArgumentIndices, int[] lambdaOutputTypeArgumentIndices, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
NOTE: lambda type indices allows extraction of Type from lambdas. To extract input type IN1
from the function given below one should pass new int[] {0,1,0} as lambdaInput1TypeArgumentIndices.
OUT apply(Map> value1, List value2)
IN1 - Left side input typeIN2 - Right side input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functioninput1TypeArgumentIndex - Index of first input type in the class specificationinput2TypeArgumentIndex - Index of second input type in the class specificationoutputTypeArgumentIndex - Index of output type in the class specificationlambdaInput1TypeArgumentIndices - Table of indices of the type argument specifying the first input type. See example.lambdaInput2TypeArgumentIndices - Table of indices of the type argument specifying the second input type. See example.lambdaOutputTypeArgumentIndices - Table of indices of the type argument specifying the input type. See example.in1Type - Type of the left side input elements (In case of an iterable, it is the element type)in2Type - Type of the right side input elements (In case of an iterable, it is the element type)functionName - Function nameallowMissing - Can the type information be missingpublic static <T> TypeInformation<T> createTypeInfo(Class<T> type)
public static TypeInformation<?> createTypeInfo(Type t)
@PublicEvolving public static <OUT> TypeInformation<OUT> createTypeInfo(Object instance, Class<?> baseClass, Class<?> clazz, int returnParamPos)
TypeInformation from the given parameters.
If the given instance implements ResultTypeQueryable, its information
is used to determine the type information. Otherwise, the type information is derived
based on the given class information.OUT - output typeinstance - instance to determine type information forbaseClass - base class of instanceclazz - class of instancereturnParamPos - index of the return type in the type arguments of clazz@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> createTypeInfo(Class<?> baseClass, Class<?> clazz, int returnParamPos, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static Type getParameterType(Class<?> baseClass, Class<?> clazz, int pos)
@Internal public static <OUT> TypeInfoFactory<OUT> getTypeInfoFactory(Type t)
public static <X> TypeInformation<X> getForClass(Class<X> clazz)
createTypeInfo(Type) is the recommended method for type extraction
(a Class is a child of Type).clazz - a Class to create TypeInformation forprotected <OUT,IN1,IN2> TypeInformation<OUT> analyzePojo(Class<OUT> clazz, ArrayList<Type> typeHierarchy, ParameterizedType parameterizedType, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type)
@PublicEvolving public static List<Field> getAllDeclaredFields(Class<?> clazz, boolean ignoreDuplicates)
clazz - class to be analyzedignoreDuplicates - if true, in case of duplicate field names only the lowest one
in a hierarchy will be returned; throws an exception otherwisepublic static <X> TypeInformation<X> getForObject(X value)
public static <T> TypeInformation<T> createHadoopWritableTypeInfo(Class<T> clazz)
Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.