public class RelativeDateRangePredicateEvaluator extends DateRangePredicateEvaluator
RelativeDateRangePredicateEvaluator
is an extension of the
DateRangePredicateEvaluator
that does not use absolute UNIX
timestamps for lowerBound
and upperBound
, but
relative offsets to the current server time. If you only specify either one,
the default value will be 0, indicating now.
It also supports the bugzilla syntax 1s 2m 3h 4d 5w 6M 7y (one second, two minutes, three hours, four days, five weeks, 6 months, 7 years). It does not take leap years into consideration and all months are 30 days.
Note: Does not implement filtering, which means this predicate cannot be used together with filter-only predicates in an OR group.
upperBound=3600000
lowerBound=-86400000
lowerBound=86400000
, upperBound=172800000
EARLIER_THAN_LAST_YEAR, LAST_THREE_MONTHS, LAST_YEAR, THIS_MONTH, THIS_WEEK, THIS_YEAR, TIME_ZONE, TODAY
LOWER_BOUND, LOWER_OPERATION, PROPERTY, PROPERTY_DECIMAL, UPPER_BOUND, UPPER_OPERATION
Constructor and Description |
---|
RelativeDateRangePredicateEvaluator() |
Modifier and Type | Method and Description |
---|---|
String |
getXPathExpression(Predicate p,
EvaluationContext context)
Default implementation that always returns
null , ie. |
long |
parseDateRange(String daterange) |
canFilter, canXpath, getFacetExtractor, parseDateString
getOrderByProperties, includes
getOrderByComparator, isFiltering
public String getXPathExpression(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
null
, ie. adds
nothing to the XPath query. Subclasses can choose whether they want to
implement this method or use the
AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext)
method for advanced
filtering (or both).getXPathExpression
in interface PredicateEvaluator
getXPathExpression
in class DateRangePredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationpublic long parseDateRange(String daterange) throws NumberFormatException
NumberFormatException
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"