Class AddUtilFunction

java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.AddUtilFunction
All Implemented Interfaces:
ContextualUtilFunction

public class AddUtilFunction extends UtilFunction implements 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 Details

  • Constructor Details

    • AddUtilFunction

      public AddUtilFunction()
  • Method Details

    • call

      public Object call(HigsonContext ctx, Object[] args)
      This method is used to perform a specific operation based on the given arguments.
      Specified by:
      call in class UtilFunction
      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.