Package org.xwiki.livedata
Class LiveDataQuery.Filter
- java.lang.Object
-
- org.xwiki.livedata.LiveDataQuery.Filter
-
- Enclosing class:
- LiveDataQuery
public static class LiveDataQuery.Filter extends Object
A set of constraints to apply to a given property.
-
-
Constructor Summary
Constructors Constructor Description Filter()
Default constructor.Filter(String property, boolean matchAll, Object... values)
Creates a new filter for the specified property, using the given values.Filter(String property, Object value)
Creates a new filter for the specified property, using the given value.Filter(String property, String operator, boolean matchAll, Object... values)
Creates a new filter for the specified property, using the given values.Filter(String property, String operator, Object value)
Creates a new filter for the specified property, using the given value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<LiveDataQuery.Constraint>
getConstraints()
String
getProperty()
boolean
isMatchAll()
void
setMatchAll(boolean matchAll)
Sets whether the property value needs to match all the constraints or any.void
setProperty(String property)
Sets the property to filter.
-
-
-
Constructor Detail
-
Filter
public Filter()
Default constructor.
-
Filter
public Filter(String property, Object value)
Creates a new filter for the specified property, using the given value.- Parameters:
property
- the property to filter onvalue
- the value to match, using the default operator for the specified property
-
Filter
public Filter(String property, String operator, Object value)
Creates a new filter for the specified property, using the given value.- Parameters:
property
- the property to filter onoperator
- the operator to use to match the given value (e.g. 'equals', 'contains', 'startsWith')value
- the value to match, using the specified operator
-
Filter
public Filter(String property, boolean matchAll, Object... values)
Creates a new filter for the specified property, using the given values.- Parameters:
property
- the property to filter onmatchAll
- whether to match all the given values or any of themvalues
- the values to match, using the default operator for the specified property
-
Filter
public Filter(String property, String operator, boolean matchAll, Object... values)
Creates a new filter for the specified property, using the given values.- Parameters:
property
- the property to filter onoperator
- the operator to use to match the given values (e.g. 'equals', 'contains', 'startsWith')matchAll
- whether to match all the given values or any of themvalues
- the values to match, using the specified operator
-
-
Method Detail
-
getProperty
public String getProperty()
- Returns:
- the property to filter
-
setProperty
public void setProperty(String property)
Sets the property to filter.- Parameters:
property
- the property to filter
-
isMatchAll
public boolean isMatchAll()
- Returns:
true
if all thegetConstraints()
have to be met,false
if any of them need to be satisfied
-
setMatchAll
public void setMatchAll(boolean matchAll)
Sets whether the property value needs to match all the constraints or any.- Parameters:
matchAll
-true
to match all constraints,false
to match any of them
-
getConstraints
public List<LiveDataQuery.Constraint> getConstraints()
- Returns:
- the list of constraints to apply to a given property
-
-