Class NumberRange
- java.lang.Object
-
- co.elasticsearch.enterprisesearch.client.model.request.search.range.NumberRange
-
- All Implemented Interfaces:
Range<BigDecimal>
public class NumberRange extends Object implements Range<BigDecimal>
Represents a number range
-
-
Constructor Summary
Constructors Constructor Description NumberRange()Create a new empty number rangeNumberRange(Double from, Double to)Create a new number rangeNumberRange(Float from, Float to)Create a new number rangeNumberRange(Integer from, Integer to)Create a new number rangeNumberRange(Long from, Long to)Create a new number rangeNumberRange(String from, String to)Create a new number rangeNumberRange(BigDecimal from, BigDecimal to)Create a new number range
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)BigDecimalgetFrom()Inclusive lower bound of the range.StringgetName()Name given to the rangeBigDecimalgetTo()Exclusive upper bound of the range.inthashCode()NumberRangesetFrom(BigDecimal from)Inclusive lower bound of the range.NumberRangesetName(String name)Name given to the rangeNumberRangesetTo(BigDecimal to)Exclusive upper bound of the range.StringtoString()
-
-
-
Constructor Detail
-
NumberRange
public NumberRange()
Create a new empty number range
-
NumberRange
public NumberRange(BigDecimal from, BigDecimal to)
Create a new number range- Parameters:
from- The start of the number rangeto- The end of the number range
-
NumberRange
public NumberRange(String from, String to)
Create a new number range- Parameters:
from- The start of the number rangeto- The end of the number range
-
NumberRange
public NumberRange(Integer from, Integer to)
Create a new number range- Parameters:
from- The start of the number rangeto- The end of the number range
-
NumberRange
public NumberRange(Long from, Long to)
Create a new number range- Parameters:
from- The start of the number rangeto- The end of the number range
-
NumberRange
public NumberRange(Float from, Float to)
Create a new number range- Parameters:
from- The start of the number rangeto- The end of the number range
-
-
Method Detail
-
getFrom
public BigDecimal getFrom()
Inclusive lower bound of the range. Is required if to is not given.- Specified by:
getFromin interfaceRange<BigDecimal>- Returns:
- the lower bound
-
getTo
public BigDecimal getTo()
Exclusive upper bound of the range. Is required if from is not given.- Specified by:
getToin interfaceRange<BigDecimal>- Returns:
- the upper bound
-
getName
public String getName()
Name given to the range- Returns:
- the range name
-
setFrom
public NumberRange 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 NumberRange setTo(BigDecimal to)
Exclusive upper bound of the range. Is required if from is not given.- Parameters:
to- the upper bound- Returns:
this.
-
setName
public NumberRange setName(String name)
Name given to the range- Parameters:
name- the range name- Returns:
this.
-
-