Class NumberRangeFilter
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.model.request.search.filter.NumberRangeFilter
-
- All Implemented Interfaces:
FieldFilter,Filter
public class NumberRangeFilter extends Object implements Filter, FieldFilter
Represents a Number Range Filter for a search request
-
-
Constructor Summary
Constructors Constructor Description NumberRangeFilter(String name)NumberRangeFilter(String name, Double from, Double to)Create a NumberRangeFilter with the given name, start, and endNumberRangeFilter(String name, Float from, Float to)Create a NumberRangeFilter with the given name, start, and endNumberRangeFilter(String name, Integer from, Integer to)Create a NumberRangeFilter with the given name, start, and endNumberRangeFilter(String name, Long from, Long to)Create a NumberRangeFilter with the given name, start, and endNumberRangeFilter(String name, BigDecimal from, BigDecimal to)Create a NumberRangeFilter with the given name, start, and end
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)BigDecimalgetFrom()Inclusive lower bound of the range.StringgetName()The field from your schema upon which to apply your filterNumberRangegetRange()Get the range for this filterBigDecimalgetTo()Exclusive upper bound of the range.inthashCode()NumberRangeFiltersetFrom(BigDecimal from)Inclusive lower bound of the range.NumberRangeFiltersetRange(NumberRange range)Set the rangeNumberRangeFiltersetTo(BigDecimal to)Exclusive upper bound of the range.StringtoString()
-
-
-
Constructor Detail
-
NumberRangeFilter
public NumberRangeFilter(String name, BigDecimal from, BigDecimal to)
Create a NumberRangeFilter with the given name, start, and end- Parameters:
name- the filter namefrom- the filter startto- the filter end
-
NumberRangeFilter
public NumberRangeFilter(String name, Integer from, Integer to)
Create a NumberRangeFilter with the given name, start, and end- Parameters:
name- the filter namefrom- the filter startto- the filter end
-
NumberRangeFilter
public NumberRangeFilter(String name, Long from, Long to)
Create a NumberRangeFilter with the given name, start, and end- Parameters:
name- the filter namefrom- the filter startto- the filter end
-
NumberRangeFilter
public NumberRangeFilter(String name, Float from, Float to)
Create a NumberRangeFilter with the given name, start, and end- Parameters:
name- the filter namefrom- the filter startto- the filter end
-
NumberRangeFilter
public NumberRangeFilter(String name, Double from, Double to)
Create a NumberRangeFilter with the given name, start, and end- Parameters:
name- the filter namefrom- the filter startto- the filter end
-
NumberRangeFilter
public NumberRangeFilter(String name)
-
-
Method Detail
-
setRange
public NumberRangeFilter setRange(NumberRange range)
Set the range- Parameters:
range- The range for this filter- Returns:
- This filter
-
getRange
public NumberRange getRange()
Get the range for this filter- Returns:
- The 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 BigDecimal getFrom()
Inclusive lower bound of the range. Is required if to is not given.- Returns:
- the lower bound
-
getTo
public BigDecimal getTo()
Exclusive upper bound of the range. Is required if from is not given.- Returns:
- the upper bound
-
setFrom
public NumberRangeFilter setFrom(BigDecimal from)
Inclusive lower bound of the range. Is required if to is not given.- Parameters:
from- the lower bound- Returns:
this.
-
setTo
public NumberRangeFilter setTo(BigDecimal to)
Exclusive upper bound of the range. Is required if from is not given.- Parameters:
to- the upper bound- Returns:
this.
-
-