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 boolean
containsParameter(String name)
Determines whether this condition contains the parameter identified by the specified name.boolean
equals(Object o)
ConditionType
getConditionType()
Retrieves the associated condition type.String
getConditionTypeId()
Retrieves the identifier of the associated condition type.Object
getParameter(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.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.String
toString()
-
-
-
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:
true
if this condition contains a parameter with the specified name,false
otherwise
-
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
null
if 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
-
-