@Public public class TypeExtractor extends Object
| 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 <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 List<Field> |
getAllDeclaredFields(Class<?> clazz)
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,
boolean hasIterables,
boolean hasCollector,
TypeInformation<IN1> in1Type,
TypeInformation<IN2> in2Type,
String functionName,
boolean allowMissing)
Returns the binary operator's return type.
|
static <IN1,IN2,OUT> |
getBinaryOperatorReturnType(Function function,
Class<?> baseClass,
int inputTypeArgumentIndex,
int outputTypeArgumentIndex,
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) |
static <IN,OUT> TypeInformation<OUT> |
getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing) |
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 <IN,OUT> TypeInformation<OUT> |
getUnaryOperatorReturnType(Function function,
Class<?> baseClass,
boolean hasIterable,
boolean hasCollector,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing)
Returns the unary operator's return type.
|
static <IN,OUT> TypeInformation<OUT> |
getUnaryOperatorReturnType(Function function,
Class<?> baseClass,
int inputTypeArgumentIndex,
int outputTypeArgumentIndex,
TypeInformation<IN> inType,
String functionName,
boolean allowMissing)
Returns the unary operator's return type.
|
static boolean |
isClassType(Type t) |
static Class<?> |
typeToClass(Type t) |
@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 public static <IN,OUT> TypeInformation<OUT> getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface, TypeInformation<IN> inType)
@PublicEvolving public static <IN,OUT> TypeInformation<OUT> getFoldReturnTypes(FoldFunction<IN,OUT> foldInterface, 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, boolean hasIterable, boolean hasCollector, TypeInformation<IN> inType, String functionName, boolean allowMissing)
IN - Input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functionhasIterable - True if the first function parameter is an iterable, otherwise falsehasCollector - True if the function has an additional collector parameter, otherwise falseinType - 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 <IN,OUT> TypeInformation<OUT> getUnaryOperatorReturnType(Function function, Class<?> baseClass, int inputTypeArgumentIndex, int outputTypeArgumentIndex, TypeInformation<IN> inType, String functionName, boolean allowMissing)
IN - Input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functioninputTypeArgumentIndex - Index of the type argument of function's first parameter
specifying the input type if it is wrapped (Iterable, Map,
etc.). Otherwise -1.outputTypeArgumentIndex - Index of the type argument of functions second parameter
specifying the output type if it is wrapped in a Collector.
Otherwise -1.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, boolean hasIterables, boolean hasCollector, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
IN1 - Left side input typeIN2 - Right side input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functionhasIterables - True if the first function parameter is an iterable, otherwise falsehasCollector - True if the function has an additional collector parameter, otherwise falsein1Type - 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 missing@PublicEvolving public static <IN1,IN2,OUT> TypeInformation<OUT> getBinaryOperatorReturnType(Function function, Class<?> baseClass, int inputTypeArgumentIndex, int outputTypeArgumentIndex, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing)
IN1 - Left side input typeIN2 - Right side input typeOUT - Output typefunction - Function to extract the return type frombaseClass - Base class of the functioninputTypeArgumentIndex - Index of the type argument of function's first parameter
specifying the input type if it is wrapped (Iterable, Map,
etc.). Otherwise -1.outputTypeArgumentIndex - Index of the type argument of functions second parameter
specifying the output type if it is wrapped in a Collector.
Otherwise -1.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)
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)
@Internal public static boolean isClassType(Type t)
public static <X> TypeInformation<X> getForObject(X value)
Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.