Package org.apache.unomi.api.conditions
Class Condition
java.lang.Object
org.apache.unomi.api.conditions.Condition
- All Implemented Interfaces:
Serializable
A set of elements that can be evaluated.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new Condition.Condition
(ConditionType conditionType) Instantiates a new Condition with the specifiedConditionType
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
containsParameter
(String name) Determines whether this condition contains the parameter identified by the specified name.boolean
Retrieves the associated condition type.Retrieves the identifier of the associated condition type.getParameter
(String name) Retrieves the parameter identified by the specified name.Retrieves a Map of all parameter name - value pairs for this condition.int
hashCode()
void
setConditionType
(ConditionType conditionType) Sets the condition type.void
setConditionTypeId
(String conditionTypeId) Sets the identifier of the associated condition type.void
setParameter
(String name, Object value) Sets the parameter identified by the specified name to the specified value.void
setParameterValues
(Map<String, Object> parameterValues) Sets the parameter name - value pairs for this profile.toString()
-
Constructor Details
-
Condition
public Condition()Instantiates a new Condition. -
Condition
Instantiates a new Condition with the specifiedConditionType
.- Parameters:
conditionType
- the condition type
-
-
Method Details
-
getConditionType
Retrieves the associated condition type.- Returns:
- the condition type
-
setConditionType
Sets the condition type.- Parameters:
conditionType
- the condition type
-
getConditionTypeId
Retrieves the identifier of the associated condition type.- Returns:
- the identifier of the associated condition type
-
setConditionTypeId
Sets the identifier of the associated condition type.- Parameters:
conditionTypeId
- the identifier of the associated condition type
-
getParameterValues
Retrieves a Map of all parameter name - value pairs for this condition.- Returns:
- a Map of all parameter name - value pairs for this condition. These depend on the condition type being used in the condition.
-
setParameterValues
Sets the parameter name - value pairs for this profile.- Parameters:
parameterValues
- a Map containing the parameter name - value pairs for this profile
-
containsParameter
Determines whether this condition contains the parameter identified by the specified name.- Parameters:
name
- the name identifying the parameter whose existence we want to determine- Returns:
true
if this condition contains a parameter with the specified name,false
otherwise
-
getParameter
Retrieves the parameter identified by the specified name.- Parameters:
name
- the name of the parameter to retrieve- Returns:
- the value of the specified parameter or
null
if no such parameter exists
-
setParameter
Sets the parameter identified by the specified name to the specified value. If a parameter with that name already exists, replaces its value, otherwise adds the new parameter with the specified name and value.- Parameters:
name
- the name of the parameter to setvalue
- the value of the parameter
-
equals
-
hashCode
public int hashCode() -
toString
-