Package com.suncode.pwfl.core.function
Interface Function
Function defined as set of overrides with common name and different parameters.
- Author:
- RafaĆ Nowacki 15 gru 2015, Cezary Kozar 29 kwi 2016
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOverride
(FunctionOverride override) Adds override to the list of overrides<T> T
<T> T
<T> T
Invokes this function with given arguments.<T> T
Invokes this function with given arguments.getName()
Returns unique function name.getOverride
(Type<?>... parameterTypes) Returns this function override that matches given parameter types.getOverride
(Type<?> returnType, Type<?>... parameterTypes) getOverride
(Type<?> returnType, Object... args) getOverride
(Object... args) Returns this function override that matches given arguments.Returns list of available overrides (at least 1).
-
Method Details
-
getName
String getName()Returns unique function name. Used as identifier inFunctionRegistry
.- Returns:
- function name
-
getOverrides
List<FunctionOverride> getOverrides()Returns list of available overrides (at least 1).- Returns:
- function overrides
-
getOverride
Returns this function override that matches given parameter types.- Parameters:
parameterTypes
- parameter types- Returns:
- override matching parameter types or null if there is no matching override
-
getOverride
-
getOverride
Returns this function override that matches given arguments.- Parameters:
args
- invocation args- Returns:
- override matching arguments or null if there is no matching override
-
getOverride
-
addOverride
Adds override to the list of overrides- Parameters:
override
- Override to add
-
call
Invokes this function with given arguments. Algorithm chooses matching override and calls itsFunctionOverride.call(Object...)
function. Returns call result.- Parameters:
args
- call arguments- Returns:
- function call result
- Throws:
FunctionCallException
- in case of error
-
call
- Throws:
FunctionCallException
-
call
Invokes this function with given arguments. Provided parameter types will be used to choose matching override. ReturnsFunctionOverride.call(Object...)
result.- Parameters:
parameterTypes
- parameter typesargs
- call arguments- Returns:
- function call result
- Throws:
FunctionCallException
- in case of error
-
call
<T> T call(Type<?> returnType, List<Type<?>> parameterTypes, Object... args) throws FunctionCallException - Throws:
FunctionCallException
-