Class AbsFunction
- java.lang.Object
-
- com.api.jsonata4java.expressions.functions.FunctionBase
-
- com.api.jsonata4java.expressions.functions.AbsFunction
-
public class AbsFunction extends FunctionBase
Returns the absolute value of the number parameter, i.e. if the number is negative, it returns the positive value.
http://docs.jsonata.org/numeric-functions.html
$abs(number)
If number is not specified (i.e. this function is invoked with no arguments), then the context value is used as the value of number.
Examples:
$abs(5)==5
$abs(-5)==5
NOTE: FROM THE java.math::abs() FUNCTION JAVADOC:
Note that if the argument is equal to the value ofLong.MIN_VALUE, the most negative representablelongvalue, the result is that same value, which is negative.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
FunctionBase.CtxEvalResult
-
-
Field Summary
Fields Modifier and Type Field Description static StringERR_ARG1BADTYPEstatic StringERR_ARG2BADTYPEstatic StringERR_BAD_CONTEXT
-
Constructor Summary
Constructors Constructor Description AbsFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxArgs()intgetMinArgs()StringgetSignature()com.fasterxml.jackson.databind.JsonNodeinvoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx)-
Methods inherited from class com.api.jsonata4java.expressions.functions.FunctionBase
evalContext, getArgumentCount, getFunctionName
-
-
-
-
Method Detail
-
invoke
public com.fasterxml.jackson.databind.JsonNode invoke(ExpressionsVisitor expressionVisitor, MappingExpressionParser.Function_callContext ctx)
- Specified by:
invokein classFunctionBase
-
getMaxArgs
public int getMaxArgs()
- Specified by:
getMaxArgsin classFunctionBase
-
getMinArgs
public int getMinArgs()
- Specified by:
getMinArgsin classFunctionBase
-
getSignature
public String getSignature()
- Specified by:
getSignaturein classFunctionBase
-
-