Class inListFunction
java.lang.Object
org.apache.activemq.filter.function.inListFunction
- All Implemented Interfaces:
FilterFunction
Filter function that matches a value against a list of values and evaluates to an indicator of membership in the
list. For example:
INLIST( SPLIT('1,2,3', ',') , '2' )
Note that the first argument must be a List. Strings containing lists are not acceptable; for example, INLIST('1,2,3', '1'), will cause an exception to be thrown at evaluation-time.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) Evalutate the given expression, which consists of a call to this function, in the context given.booleanCheck whether the given expression is a valid call of this function.booleanCheck whether the given expression, which consists of a call to this function, evaluates to a Boolean.
-
Constructor Details
-
inListFunction
public inListFunction()
-
-
Method Details
-
isValid
Check whether the given expression is a valid call of this function. Two arguments are required. Note that the evaluated results of the arguments will be compared with Object#equals().- Specified by:
isValidin interfaceFilterFunction- Parameters:
expr- - the expression consisting of a call to this function.- Returns:
- true - if the expression is valid; false - otherwise.
-
returnsBoolean
Check whether the given expression, which consists of a call to this function, evaluates to a Boolean. If the function can return different more than one type of value at evaluation-time, it must decide whether to cast the result to a Boolean at this time.- Specified by:
returnsBooleanin interfaceFilterFunction- Parameters:
expr- - the expression consisting of a call to this function.- Returns:
- true - if the expression is valid; false - otherwise.
-
evaluate
public Object evaluate(FunctionCallExpression expr, MessageEvaluationContext message_ctx) throws jakarta.jms.JMSException Evalutate the given expression, which consists of a call to this function, in the context given. Checks whether the second argument is a member of the list in the first argument.- Specified by:
evaluatein interfaceFilterFunction- Parameters:
expr- - the expression consisting of a call to this function.message_ctx- - the context in which the call is being evaluated.- Returns:
- Boolean - the result of the evaluation.
- Throws:
jakarta.jms.JMSException
-