- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.func.FirstOrderFunctionSignature<RETURN>
-
- org.ow2.authzforce.core.pdp.api.func.SingleParameterTypedFirstOrderFunctionSignature<RETURN,PARAM>
-
- Type Parameters:
RETURN
- function's return typePARAM
- common parameter type
public class SingleParameterTypedFirstOrderFunctionSignature<RETURN extends Value,PARAM extends Value> extends FirstOrderFunctionSignature<RETURN>
First-order function signature having every parameter of the same datatype
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.func.FirstOrderFunctionSignature
isVarArgs, name, returnType, UNDEF_PARAMETER_TYPES_EXCEPTION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Datatype<PARAM>
getParameterType()
Get single/common parameter datatypeList<? extends Datatype<?>>
getParameterTypes()
Get function parameter typesint
hashCode()
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.FirstOrderFunctionSignature
getName, getReturnType, isVarArgs, toString
-
-
-
-
Constructor Detail
-
SingleParameterTypedFirstOrderFunctionSignature
public SingleParameterTypedFirstOrderFunctionSignature(String name, Datatype<RETURN> returnType, boolean varArgs, List<? extends Datatype<PARAM>> parameterTypes) throws IllegalArgumentException
Creates function signature- Parameters:
name
- function name (e.g. XACML-defined URI)returnType
- function's return typeparameterTypes
- function parameter types. Note: the "? extends" allows usingBagDatatype
as parameterTypevarArgs
- true iff the function takes a variable number of arguments (like JavaMethod.isVarArgs()
, i.e. the final type inparamTypes
can be repeated 0 or more times to match a variable-length argumentExamples with varargs=true ('...' means varargs like in Java):
Example 1: string-concat(string, string, string...) -> paramTypes={string, string, string}
Example 2: or(boolean...) -> paramTypes={boolean} (As you can see, isVarargs=true really means 0 or more args; indeed, the or function can take 0 parameter according to spec)
Example 3: n-of(integer, boolean...) -> paramTypes={integer, boolean}
- Throws:
IllegalArgumentException
- if (name == null || returnType == null || parameterTypes == null || parameterTypes.isEmpty()
)
-
-
Method Detail
-
getParameterType
public Datatype<PARAM> getParameterType()
Get single/common parameter datatype- Returns:
- parameter datatype
-
getParameterTypes
public List<? extends Datatype<?>> getParameterTypes()
Get function parameter types- Specified by:
getParameterTypes
in classFirstOrderFunctionSignature<RETURN extends Value>
- Returns:
- function parameter types
-
-