public class TimeInRangeFunction extends FunctionBase
Note that this function allows any time ranges less than 24 hours. In other words, it is not bound by normal day boundries (midnight GMT), but by the minimum time in the range. This means that ranges like 9am-5pm are supported, as are ranges like 5pm-9am.
Modifier and Type | Field and Description |
---|---|
static long |
MILLIS_PER_DAY
The number of milliseconds in a day
|
static long |
MILLIS_PER_MINUTE
The number of milliseconds in a minute
|
static String |
NAME
The identifier for this function
|
FUNCTION_NS, FUNCTION_NS_2
Constructor and Description |
---|
TimeInRangeFunction()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
EvaluationResult |
evaluate(List inputs,
EvaluationCtx context)
Evaluates the time-in-range function, which takes three
TimeAttribute values. |
checkInputs, checkInputsNoBag, encode, encode, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, getType, makeProcessingError, returnsBag
public static final String NAME
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_DAY
public EvaluationResult evaluate(List inputs, EvaluationCtx context)
TimeAttribute
values. This function return true
if the first value falls between the second and third values
(ie., on or after the second time and on or before the third
time). If no time zone is specified for the second and/or third
time value, then the timezone from the first time value is
used. This lets you say time-in-range(current-time, 9am, 5pm)
and always have the evaluation happen in your current-time
timezone.inputs
- a List
of Evaluatable
objects representing the arguments passed to the functioncontext
- the respresentation of the requestEvaluationResult
containing true or falseCopyright © 2023 JBoss by Red Hat. All rights reserved.