Class DatatypeConversionFunction<PARAM_T extends AttributeValue,RETURN_T extends AttributeValue>
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.func.BaseFunction<RETURN>
-
- org.ow2.authzforce.core.pdp.api.func.FirstOrderFunction<RETURN_T>
-
- org.ow2.authzforce.core.pdp.api.func.SingleParameterTypedFirstOrderFunction<RETURN_T,PARAM_T>
-
- org.ow2.authzforce.core.pdp.api.func.DatatypeConversionFunction<PARAM_T,RETURN_T>
-
- Type Parameters:
PARAM_T
- parameter/input typeRETURN_T
- return/output type
- All Implemented Interfaces:
Function<RETURN_T>
,PdpExtension
,PrimitiveValue
,Value
public class DatatypeConversionFunction<PARAM_T extends AttributeValue,RETURN_T extends AttributeValue> extends SingleParameterTypedFirstOrderFunction<RETURN_T,PARAM_T>
A superclass of primitive datatype conversion functions such as double-to-integer, integer-to-double, *-from-string, *-to-string, etc. May be used for non-standard datatype conversion functions as well. A datatype conversion function takes one argument of a given type and converts that argument to another given type.- Version:
- $Id: $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DatatypeConversionFunction.TypeConverter<RETURN,PARAM>
Data converter
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.func.SingleParameterTypedFirstOrderFunction
functionSignature
-
Fields inherited from interface org.ow2.authzforce.core.pdp.api.func.Function
AUTHZFORCE_EXTENSION_PREFIX, XACML_NS_1_0, XACML_NS_2_0, XACML_NS_3_0
-
-
Constructor Summary
Constructors Constructor Description DatatypeConversionFunction(String functionID, Datatype<PARAM_T> paramType, Datatype<RETURN_T> returnType, DatatypeConversionFunction.TypeConverter<RETURN_T,PARAM_T> converter)
Creates a newDatatypeConversionFunction
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirstOrderFunctionCall<RETURN_T>
newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes)
Returns a function call for calling this function.-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.SingleParameterTypedFirstOrderFunction
getParameterTypes, getReturnType
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.FirstOrderFunction
newCall
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.func.BaseFunction
equals, getId, getIndeterminateArgException, getIndeterminateArgMessage, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ow2.authzforce.core.pdp.api.func.Function
getXdmItem
-
Methods inherited from interface org.ow2.authzforce.core.pdp.api.value.PrimitiveValue
getXdmValue
-
-
-
-
Constructor Detail
-
DatatypeConversionFunction
public DatatypeConversionFunction(String functionID, Datatype<PARAM_T> paramType, Datatype<RETURN_T> returnType, DatatypeConversionFunction.TypeConverter<RETURN_T,PARAM_T> converter)
Creates a newDatatypeConversionFunction
object.- Parameters:
functionID
- function IDparamType
- parameter typereturnType
- return typeconverter
- type converter
-
-
Method Detail
-
newCall
public FirstOrderFunctionCall<RETURN_T> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes) throws IllegalArgumentException
Returns a function call for calling this function.- Specified by:
newCall
in classFirstOrderFunction<RETURN_T extends AttributeValue>
- Parameters:
argExpressions
- function arguments (expressions)remainingArgTypes
- types of remaining inputs to be passed only at request evaluation time, if not all arguments are specified inargExpressions
. Therefore, only their type is checked at this point. The actual argument values will be passed as last parameters when callingBaseFirstOrderFunctionCall.evaluate(org.ow2.authzforce.core.pdp.api.EvaluationContext, Optional, boolean, org.ow2.authzforce.core.pdp.api.value.AttributeValue...)
at request evaluation time, via the returnedFunctionCall
.- Returns:
- Function call handle for calling this function which such inputs (with possible changes from original inputs due to optimizations for instance)
- Throws:
IllegalArgumentException
- if inputs are invalid for this function
-
-