public final class RangeUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RangeUtil.Range |
Modifier and Type | Method and Description |
---|---|
static RangeUtil.Range |
getRange(java.lang.String rangeQuery,
int minValue,
int maxValue)
Determine the range of values being requested in the given query.
|
static RangeUtil.Range |
getRange(java.lang.String prefix,
java.lang.String test,
int queryInt,
int minValue,
int maxValue)
Determine the range of values being requested in the given query.
|
public static RangeUtil.Range getRange(java.lang.String rangeQuery, int minValue, int maxValue)
rangeQuery
- the raw query, e.g. "added:>12345
"minValue
- the minimum possible value for the field, inclusivemaxValue
- the maximum possible value for the field, inclusiveRangeUtil.Range
, or null if the query is invalidpublic static RangeUtil.Range getRange(java.lang.String prefix, java.lang.String test, int queryInt, int minValue, int maxValue)
prefix
- a prefix string which is copied into the rangetest
- the test operator, one of >, >=, =, <, or <=queryInt
- the integer being queriedminValue
- the minimum possible value for the field, inclusivemaxValue
- the maximum possible value for the field, inclusiveRangeUtil.Range