Package org.dizitart.no2.filters
Class FluentFilter
- java.lang.Object
-
- org.dizitart.no2.filters.FluentFilter
-
public final class FluentFilter extends Object
A fluent api for theNitriteFilter.- Since:
- 4.0
- Author:
- Anindya Chatterjee.
-
-
Field Summary
Fields Modifier and Type Field Description static FluentFilter$The where clause for elemMatch filter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NitriteFilterbetween(Comparable<?> lowerBound, Comparable<?> upperBound)Creates a filter that matches documents where the value of the field is between the specified lower and upper bounds.NitriteFilterbetween(Comparable<?> lowerBound, Comparable<?> upperBound, boolean inclusive)Creates a filter that matches documents where the value of the field is between the given lower and upper bounds.NitriteFilterbetween(Comparable<?> lowerBound, Comparable<?> upperBound, boolean lowerInclusive, boolean upperInclusive)Creates a filter that matches documents where the value of a field is between two specified values.NitriteFilterelemMatch(Filter filter)Creates a filter that matches documents where the value of a field contains at least one element that matches the specified filter.NitriteFiltereq(Object value)Creates an equality filter that matches documents where the value of a field equals the specified value.NitriteFiltergt(Comparable<?> value)Creates a filter that matches all documents where the value of the specified field is greater than the given value.NitriteFiltergte(Comparable<?> value)Creates a filter that matches documents where the value of the field is greater than or equal to the specified value.NitriteFilterin(Comparable<?>... values)Creates a filter that matches documents where the value of the field is in the specified array of values.NitriteFilterlt(Comparable<?> value)Creates a filter that matches documents where the value of the field is less than the specified value.NitriteFilterlte(Comparable<?> value)Creates a filter that matches documents where the value of the field is less than or equal to the specified value.NitriteFilternotEq(Object value)Creates a filter that matches all documents where the value of the specified field is not equal to the given value.NitriteFilternotIn(Comparable<?>... values)Creates a filter that matches documents where the value of the field is not in the specified array of values.NitriteFilterregex(String value)Creates a filter that matches documents where the value of the specified field matches the specified regular expression pattern.NitriteFiltertext(String value)Creates a filter which performs a text search on the content of the fields indexed with a full-text index.static FluentFilterwhere(String field)Creates a newFluentFilterinstance with the specified field name.
-
-
-
Field Detail
-
$
public static FluentFilter $
The where clause for elemMatch filter.
-
-
Method Detail
-
where
public static FluentFilter where(String field)
Creates a newFluentFilterinstance with the specified field name.- Parameters:
field- the name of the field to filter on- Returns:
- a new
FluentFilterinstance with the specified field name
-
eq
public NitriteFilter eq(Object value)
Creates an equality filter that matches documents where the value of a field equals the specified value.- Parameters:
value- the value to match against.- Returns:
- a
NitriteFilterinstance representing the equality filter.
-
notEq
public NitriteFilter notEq(Object value)
Creates a filter that matches all documents where the value of the specified field is not equal to the given value.- Parameters:
value- the value to compare against.- Returns:
- a
NitriteFilterinstance.
-
gt
public NitriteFilter gt(Comparable<?> value)
Creates a filter that matches all documents where the value of the specified field is greater than the given value.- Parameters:
value- the value to compare against.- Returns:
- the NitriteFilter instance representing the greater than filter.
-
gte
public NitriteFilter gte(Comparable<?> value)
Creates a filter that matches documents where the value of the field is greater than or equal to the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is greater than or equal to the specified value.
-
lt
public NitriteFilter lt(Comparable<?> value)
Creates a filter that matches documents where the value of the field is less than the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is less than the specified value.
-
lte
public NitriteFilter lte(Comparable<?> value)
Creates a filter that matches documents where the value of the field is less than or equal to the specified value.- Parameters:
value- the value to compare against.- Returns:
- a filter that matches documents where the value of the field is less than or equal to the specified value.
-
between
public NitriteFilter between(Comparable<?> lowerBound, Comparable<?> upperBound)
Creates a filter that matches documents where the value of the field is between the specified lower and upper bounds.- Parameters:
lowerBound- the lower bound (inclusive) of the range to match.upperBound- the upper bound (inclusive) of the range to match.- Returns:
- a filter that matches documents where the value of the field is between the specified lower and upper bounds.
-
between
public NitriteFilter between(Comparable<?> lowerBound, Comparable<?> upperBound, boolean inclusive)
Creates a filter that matches documents where the value of the field is between the given lower and upper bounds.- Parameters:
lowerBound- the lower bound of the range (inclusive).upperBound- the upper bound of the range (inclusive).inclusive- whether the bounds are inclusive or not.- Returns:
- a filter that matches documents where the value of the field is between the given lower and upper bounds.
-
between
public NitriteFilter between(Comparable<?> lowerBound, Comparable<?> upperBound, boolean lowerInclusive, boolean upperInclusive)
Creates a filter that matches documents where the value of a field is between two specified values.- Parameters:
lowerBound- the lower bound (inclusive) of the rangeupperBound- the upper bound (inclusive) of the rangelowerInclusive- true if the lower bound is inclusive, false otherwiseupperInclusive- true if the upper bound is inclusive, false otherwise- Returns:
- a filter that matches documents where the value of a field is between two specified values
-
text
public NitriteFilter text(String value)
Creates a filter which performs a text search on the content of the fields indexed with a full-text index.- Parameters:
value- the text value- Returns:
- the text filter
- See Also:
TextTokenizer
-
regex
public NitriteFilter regex(String value)
Creates a filter that matches documents where the value of the specified field matches the specified regular expression pattern.- Parameters:
value- the regular expression pattern to match against the value of the specified field- Returns:
- a filter that matches documents where the value of the specified field matches the specified regular expression pattern
-
in
public NitriteFilter in(Comparable<?>... values)
Creates a filter that matches documents where the value of the field is in the specified array of values.- Parameters:
values- the array of values to match against- Returns:
- the filter object representing the filter
-
notIn
public NitriteFilter notIn(Comparable<?>... values)
Creates a filter that matches documents where the value of the field is not in the specified array of values.- Parameters:
values- the array of values to compare against- Returns:
- a filter that matches documents where the value of the field is not in the specified array of values
-
elemMatch
public NitriteFilter elemMatch(Filter filter)
Creates a filter that matches documents where the value of a field contains at least one element that matches the specified filter.- Parameters:
filter- the filter to apply to the matching elements- Returns:
- a filter that matches documents where the value of a field contains at least one element that matches the specified filter
-
-