Class TrimUtilFunction
java.lang.Object
io.higson.runtime.builtin.implementation.UtilFunction
io.higson.runtime.builtin.implementation.TrimUtilFunction
- All Implemented Interfaces:
ContextualUtilFunction
Represents a utility function for trimming values in a given context.
-
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) Trims values in a given context.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
-
TrimUtilFunction
public TrimUtilFunction()
-
-
Method Details
-
call
Trims values in a given context.- If the value is null, returns null.
- If the value is a Number, returns its decimal representation.
- If the value is a Boolean, returns its boolean representation.
- If the value is a Date, returns its Date representation.
- If the value is a LocalDate, returns its LocalDate representation.
- If the value is a LocalDateTime, returns its LocalDateTime representation.
- If the value is a collection, filters out null values and returns the filtered array.
- If the value is a CharSequence, trims it and returns the trimmed String.
- Specified by:
callin classUtilFunction- Parameters:
ctx- The HigsonContext object representing the context in which the trimming operation is performed.args- An array of objects representing the arguments passed to the method.- Returns:
- The trimmed value. Otherwise, returns the value as it is.
-