Class UserCodeObjectWrapper<T>
- java.lang.Object
-
- org.apache.flink.api.common.operators.util.UserCodeObjectWrapper<T>
-
- All Implemented Interfaces:
Serializable,UserCodeWrapper<T>
@Internal public class UserCodeObjectWrapper<T> extends Object implements UserCodeWrapper<T>
This holds an actual object containing user defined code.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UserCodeObjectWrapper(T userCodeObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <A extends Annotation>
AgetUserCodeAnnotation(Class<A> annotationClass)Gets an annotation that pertains to the user code class.Class<? extends T>getUserCodeClass()Gets the class of the user code.TgetUserCodeObject()Gets the user code object.TgetUserCodeObject(Class<? super T> superClass, ClassLoader cl)Gets the user code object, which may be either a function or an input or output format.booleanhasObject()Checks whether the wrapper already has an object, or whether it needs to instantiate it.
-
-
-
Constructor Detail
-
UserCodeObjectWrapper
public UserCodeObjectWrapper(T userCodeObject)
-
-
Method Detail
-
getUserCodeObject
public T getUserCodeObject(Class<? super T> superClass, ClassLoader cl)
Description copied from interface:UserCodeWrapperGets the user code object, which may be either a function or an input or output format. The subclass is supposed to just return the user code object or instantiate the class.- Specified by:
getUserCodeObjectin interfaceUserCodeWrapper<T>- Returns:
- The class with the user code.
-
getUserCodeObject
public T getUserCodeObject()
Description copied from interface:UserCodeWrapperGets the user code object. In the case of a pact, that object will be the stub with the user function, in the case of an input or output format, it will be the format object.- Specified by:
getUserCodeObjectin interfaceUserCodeWrapper<T>- Returns:
- The class with the user code.
-
getUserCodeAnnotation
public <A extends Annotation> A getUserCodeAnnotation(Class<A> annotationClass)
Description copied from interface:UserCodeWrapperGets an annotation that pertains to the user code class. By default, this method will look for annotations statically present on the user code class. However, inheritors may override this behavior to provide annotations dynamically.- Specified by:
getUserCodeAnnotationin interfaceUserCodeWrapper<T>- Parameters:
annotationClass- the Class object corresponding to the annotation type- Returns:
- the annotation, or null if no annotation of the requested type was found
-
getUserCodeClass
public Class<? extends T> getUserCodeClass()
Description copied from interface:UserCodeWrapperGets the class of the user code. If the user code is provided as a class, this class is just returned. If the user code is provided as an object,Object.getClass()is called on the user code object.- Specified by:
getUserCodeClassin interfaceUserCodeWrapper<T>- Returns:
- The class of the user code object.
-
hasObject
public boolean hasObject()
Description copied from interface:UserCodeWrapperChecks whether the wrapper already has an object, or whether it needs to instantiate it.- Specified by:
hasObjectin interfaceUserCodeWrapper<T>- Returns:
- True, if the wrapper has already an object, false if it has only a class.
-
-