Package com.sun.identity.entitlement
Class NumericAttributeCondition
- java.lang.Object
-
- com.sun.identity.entitlement.EntitlementConditionAdaptor
-
- com.sun.identity.entitlement.NumericAttributeCondition
-
- All Implemented Interfaces:
EntitlementCondition
public class NumericAttributeCondition extends EntitlementConditionAdaptor
Condition for evaluating attribute value of numeric type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NumericAttributeCondition.Operator
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_NAME_ATTRIBUTE_NAME
static String
ATTR_NAME_OPERATOR
static String
ATTR_NAME_VALUE
-
Constructor Summary
Constructors Constructor Description NumericAttributeCondition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Returnstrue
if the passed in object is equal to this objectConditionDecision
evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)
Returns condition decision.String
getAttributeName()
NumericAttributeCondition.Operator
getOperator()
String
getState()
Returns state of the object encoded as a JSON string.float
getValue()
int
hashCode()
Returns hash code of the object.void
init(Map<String,Set<String>> parameters)
Initializes the condition object.void
setAttributeName(String attributeName)
void
setOperator(NumericAttributeCondition.Operator operator)
void
setState(String state)
Sets state of this object from a JSON string.void
setValue(float value)
void
validate()
Checks that this condition is configured correctly.-
Methods inherited from class com.sun.identity.entitlement.EntitlementConditionAdaptor
getDisplayType, setDisplayType, setState, toJSONObject
-
-
-
-
Field Detail
-
ATTR_NAME_ATTRIBUTE_NAME
public static final String ATTR_NAME_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
-
ATTR_NAME_OPERATOR
public static final String ATTR_NAME_OPERATOR
- See Also:
- Constant Field Values
-
ATTR_NAME_VALUE
public static final String ATTR_NAME_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(Map<String,Set<String>> parameters)
Description copied from class:EntitlementConditionAdaptor
Initializes the condition object.- Specified by:
init
in interfaceEntitlementCondition
- Overrides:
init
in classEntitlementConditionAdaptor
- Parameters:
parameters
- Parameters for initializing the condition.
-
setState
public void setState(String state)
Description copied from interface:EntitlementCondition
Sets state of this object from a JSON string.- Parameters:
state
- State of the object encoded as a JSON string
-
getState
public String getState()
Description copied from interface:EntitlementCondition
Returns state of the object encoded as a JSON string.- Returns:
- state of the object encoded as a JSON string.
-
evaluate
public ConditionDecision evaluate(String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
Description copied from interface:EntitlementCondition
Returns condition decision.- Parameters:
realm
- Realm Name.subject
- Subject who is under evaluation.resourceName
- Resource name.environment
- Environment parameters.- Returns:
- resulting condition decision.
- Throws:
EntitlementException
- if cannot get condition decision.
-
setAttributeName
public void setAttributeName(String attributeName)
-
setOperator
public void setOperator(NumericAttributeCondition.Operator operator)
-
setValue
public void setValue(float value)
-
getAttributeName
public String getAttributeName()
-
getOperator
public NumericAttributeCondition.Operator getOperator()
-
getValue
public float getValue()
-
hashCode
public int hashCode()
Description copied from class:EntitlementConditionAdaptor
Returns hash code of the object.- Overrides:
hashCode
in classEntitlementConditionAdaptor
- Returns:
- hash code of the object.
-
equals
public boolean equals(Object obj)
Description copied from class:EntitlementConditionAdaptor
Returnstrue
if the passed in object is equal to this object- Overrides:
equals
in classEntitlementConditionAdaptor
- Parameters:
obj
- object to check for equality- Returns:
true
if the passed in object is equal to this object
-
validate
public void validate() throws EntitlementException
Description copied from interface:EntitlementCondition
Checks that this condition is configured correctly. ThrowsEntitlementException
if not with an informative message to display to the user creating/updating the policy.- Throws:
EntitlementException
- if the configuration state is not valid.
-
-