Interface UserCodeWrapper<T>
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
UserCodeClassWrapper
,UserCodeObjectWrapper
@Internal public interface UserCodeWrapper<T> extends Serializable
UDf operators can have either a class or an object containing the user code, this is the common interface to access them.
-
-
Method Summary
All Methods Instance Methods Abstract 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.T
getUserCodeObject()
Gets the user code object.T
getUserCodeObject(Class<? super T> superClass, ClassLoader cl)
Gets the user code object, which may be either a function or an input or output format.boolean
hasObject()
Checks whether the wrapper already has an object, or whether it needs to instantiate it.
-
-
-
Method Detail
-
getUserCodeObject
T getUserCodeObject(Class<? super T> superClass, ClassLoader cl)
Gets 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.- Returns:
- The class with the user code.
-
getUserCodeObject
T getUserCodeObject()
Gets 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.- Returns:
- The class with the user code.
-
getUserCodeAnnotation
<A extends Annotation> A getUserCodeAnnotation(Class<A> annotationClass)
Gets 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.- 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
Class<? extends T> getUserCodeClass()
Gets 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.- Returns:
- The class of the user code object.
-
hasObject
boolean hasObject()
Checks whether the wrapper already has an object, or whether it needs to instantiate it.- Returns:
- True, if the wrapper has already an object, false if it has only a class.
-
-