Package org.apache.unomi.api.conditions
Class Condition
- java.lang.Object
-
- org.apache.unomi.api.conditions.Condition
-
- All Implemented Interfaces:
Serializable
public class Condition extends Object implements Serializable
A set of elements that can be evaluated.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Condition()Instantiates a new Condition.Condition(ConditionType conditionType)Instantiates a new Condition with the specifiedConditionType.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsParameter(String name)Determines whether this condition contains the parameter identified by the specified name.booleanequals(Object o)ConditionTypegetConditionType()Retrieves the associated condition type.StringgetConditionTypeId()Retrieves the identifier of the associated condition type.ObjectgetParameter(String name)Retrieves the parameter identified by the specified name.Map<String,Object>getParameterValues()Retrieves a Map of all parameter name - value pairs for this condition.inthashCode()voidsetConditionType(ConditionType conditionType)Sets the condition type.voidsetConditionTypeId(String conditionTypeId)Sets the identifier of the associated condition type.voidsetParameter(String name, Object value)Sets the parameter identified by the specified name to the specified value.voidsetParameterValues(Map<String,Object> parameterValues)Sets the parameter name - value pairs for this profile.StringtoString()
-
-
-
Constructor Detail
-
Condition
public Condition()
Instantiates a new Condition.
-
Condition
public Condition(ConditionType conditionType)
Instantiates a new Condition with the specifiedConditionType.- Parameters:
conditionType- the condition type
-
-
Method Detail
-
getConditionType
public ConditionType getConditionType()
Retrieves the associated condition type.- Returns:
- the condition type
-
setConditionType
public void setConditionType(ConditionType conditionType)
Sets the condition type.- Parameters:
conditionType- the condition type
-
getConditionTypeId
public String getConditionTypeId()
Retrieves the identifier of the associated condition type.- Returns:
- the identifier of the associated condition type
-
setConditionTypeId
public void setConditionTypeId(String conditionTypeId)
Sets the identifier of the associated condition type.- Parameters:
conditionTypeId- the identifier of the associated condition type
-
getParameterValues
public Map<String,Object> 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
public void setParameterValues(Map<String,Object> parameterValues)
Sets the parameter name - value pairs for this profile.- Parameters:
parameterValues- a Map containing the parameter name - value pairs for this profile
-
containsParameter
public boolean containsParameter(String name)
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:
trueif this condition contains a parameter with the specified name,falseotherwise
-
getParameter
public Object getParameter(String name)
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
nullif no such parameter exists
-
setParameter
public void setParameter(String name, Object value)
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
-
-