Class DateRangeFilter
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.model.request.search.filter.DateRangeFilter
-
- All Implemented Interfaces:
FieldFilter,Filter
public class DateRangeFilter extends Object implements Filter, FieldFilter
Represents a Search Date Range filter
-
-
Constructor Summary
Constructors Constructor Description DateRangeFilter(String name)Create a DateRangeFilter with the given name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)OffsetDateTimegetFrom()Inclusive lower bound of the range.StringgetName()The field from your schema upon which to apply your filterDateRangegetRange()Get the filter rangeOffsetDateTimegetTo()Exclusive upper bound of the range.inthashCode()DateRangeFiltersetFrom(OffsetDateTime from)Inclusive lower bound of the range.DateRangeFiltersetName(String name)The field from your schema upon which to apply your filterDateRangeFiltersetRange(DateRange range)Set the range, upper bound exclusive, lower bound inclusiveDateRangeFiltersetTo(OffsetDateTime to)Exclusive upper bound of the range.StringtoString()
-
-
-
Constructor Detail
-
DateRangeFilter
public DateRangeFilter(String name)
Create a DateRangeFilter with the given name- Parameters:
name- the filter name
-
-
Method Detail
-
setRange
public DateRangeFilter setRange(DateRange range)
Set the range, upper bound exclusive, lower bound inclusive- Parameters:
range- The range- Returns:
- This filter
-
getRange
public DateRange getRange()
Get the filter range- Returns:
- The filter range
-
getName
public String getName()
The field from your schema upon which to apply your filter- Specified by:
getNamein interfaceFieldFilter- Returns:
- The field name
-
getFrom
public OffsetDateTime getFrom()
Inclusive lower bound of the range. Is required if to is not given.- Returns:
- the lower bound
-
getTo
public OffsetDateTime getTo()
Exclusive upper bound of the range. Is required if from is not given.- Returns:
- the upper bound
-
setName
public DateRangeFilter setName(String name)
The field from your schema upon which to apply your filter- Parameters:
name- The name of the field to filter- Returns:
this.
-
setFrom
public DateRangeFilter setFrom(OffsetDateTime from)
Inclusive lower bound of the range. Is required if to is not given.- Parameters:
from- the lower bound- Returns:
this.
-
setTo
public DateRangeFilter setTo(OffsetDateTime to)
Exclusive upper bound of the range. Is required if from is not given.- Parameters:
to- the upper bound- Returns:
this.
-
-