Class AddUtilFunction
java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.AddUtilFunction
- All Implemented Interfaces:
ContextualUtilFunction
The AddUtilFunction is a utility function designed for adding two values.
It is a helper class for performing addition operations in Java and is one of the built-in utility functions.
The second element of args is the value that will be added to the element taken from the context. The element that on which adding will be performed is fetched from the context using the provided key
path
.-
Field Summary
FieldsFields inherited from class io.higson.runtime.builtin.implementation.UtilFunction
converter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(HigsonContext ctx, Object[] args) This method is used to perform a specific operation based on the given arguments.Methods inherited from class io.higson.runtime.builtin.implementation.UtilFunction
createHigsonRuntimeException, createHigsonRuntimeException, isValid, toTemporalAmountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.higson.runtime.builtin.implementation.ContextualUtilFunction
getContextPath
-
Field Details
-
CODE
- See Also:
-
INSTANCE
-
-
Constructor Details
-
AddUtilFunction
public AddUtilFunction()
-
-
Method Details
-
call
This method is used to perform a specific operation based on the given arguments.- Specified by:
callin classUtilFunction- Parameters:
ctx- The HigsonContext object used to store and retrieve values.args- An array of arguments passed to the method. args[0] is the converter used to convert the arguments. args[1] is the value to append.- Returns:
- The result of the operation based on the arguments. Returns null if the append value is blank. Returns the result of adding two objects from the context if the append value exists in the context. Returns the result of adding the append value to the target object otherwise.
-