Class ComparisonFunction<AV extends AttributeValue & Comparable<AV>>
- 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<BooleanValue,AV>
-
- org.ow2.authzforce.core.pdp.api.func.ComparisonFunction<AV>
-
- Type Parameters:
AV
- function parameter type
- All Implemented Interfaces:
Function<BooleanValue>
,PdpExtension
,PrimitiveValue
,Value
public class ComparisonFunction<AV extends AttributeValue & Comparable<AV>> extends SingleParameterTypedFirstOrderFunction<BooleanValue,AV>
A superclass of all the standard comparison functions (return a boolean). May be used for non-standard comparison functions as well.- Version:
- $Id: $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ComparisonFunction.PostCondition
post-condition to hold true when comparing the result ofarg0.compareTo(arg1)
to zero; where compareTo() function is similar toComparable.compareTo(Object)
.
-
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 ComparisonFunction(Datatype<AV> paramType, ComparisonFunction.PostCondition postCondition)
Creates a new comparison function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FirstOrderFunctionCall<BooleanValue>
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
-
-
-
-
Constructor Detail
-
ComparisonFunction
public ComparisonFunction(Datatype<AV> paramType, ComparisonFunction.PostCondition postCondition)
Creates a new comparison function. Resulting function ID =paramType.getFuncIdPrefix() + functionSuffix
, wherefunctionSuffix
is:- If
postCondition == GREATER_THAN
, then the suffix is '-greater-than' - If
postCondition == GREATER_THAN_OR_EQUAL
, then the suffix is '-greater-than-or-equal' - If
postCondition == LESSER_THAN
, then the suffix is '-lesser-than' - If
postCondition == LESSER_THAN_OR_EQUAL
, then the suffix is '-lesser-than-or-equal'
paramType.getFuncIdPrefix()
is 'urn:oasis:names:tc:xacml:1.0:function:integer' andpostCondition == GREATER_THAN
, then the resulting function ID will be 'urn:oasis:names:tc:xacml:1.0:function:integer-greater-than'- Parameters:
paramType
- parameter typepostCondition
- post-condition to hold true when comparing the result ofarg0.compareTo(arg1)
to zero; where compareTo() function is similar toComparable.compareTo(Object)
- Throws:
IllegalArgumentException
- if the function is unknown
- If
-
-
Method Detail
-
newCall
public FirstOrderFunctionCall<BooleanValue> newCall(List<Expression<?>> argExpressions, Datatype<?>... remainingArgTypes)
Description copied from class:FirstOrderFunction
Returns a function call for calling this function.- Specified by:
newCall
in classFirstOrderFunction<BooleanValue>
- 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, 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)
-
-