Package com.google.gerrit.index.query
Class RangeUtil
- java.lang.Object
-
- com.google.gerrit.index.query.RangeUtil
-
public final class RangeUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RangeUtil.Range
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RangeUtil.Range
getRange(String rangeQuery, int minValue, int maxValue)
Determine the range of values being requested in the given query.static RangeUtil.Range
getRange(String prefix, String test, int queryInt, int minValue, int maxValue)
Determine the range of values being requested in the given query.
-
-
-
Method Detail
-
getRange
public static RangeUtil.Range getRange(String rangeQuery, int minValue, int maxValue)
Determine the range of values being requested in the given query.- Parameters:
rangeQuery
- the raw query, e.g. "added:>12345
"minValue
- the minimum possible value for the field, inclusivemaxValue
- the maximum possible value for the field, inclusive- Returns:
- the calculated
RangeUtil.Range
, or null if the query is invalid
-
getRange
public static RangeUtil.Range getRange(String prefix, String test, int queryInt, int minValue, int maxValue)
Determine the range of values being requested in the given query.- Parameters:
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, inclusive- Returns:
- the calculated
RangeUtil.Range
-
-