Class ToUtilFunction
java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.ToUtilFunction
- All Implemented Interfaces:
ContextualUtilFunction
Represents the 'to' util function that retrieves values from a target object based on the provided context and arguments.
-
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) Calls the 'to' util function with the given context and 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
-
ToUtilFunction
public ToUtilFunction()
-
-
Method Details
-
call
Calls the 'to' util function with the given context and arguments.- if object is String then function will return part of string to indexed passed in the second argument
- if object is List then function will return part of list to indexed passed in the second argument
- in other cases function will throw exception with unsupported type
- Specified by:
callin classUtilFunction- Parameters:
ctx- The HigsonContext object representing the execution context.args- The arguments passed to the 'to' util function.- Returns:
- The result of the 'to' util function, or null if the target is null or of an unsupported type.
- Throws:
HigsonRuntimeException- if a required argument is missing, or if the target is of an unsupported type.
-