Class TrimUtilFunction

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

public class TrimUtilFunction extends UtilFunction implements ContextualUtilFunction
Represents a utility function for trimming values in a given context.
  • Field Details

  • Constructor Details

    • TrimUtilFunction

      public TrimUtilFunction()
  • Method Details

    • call

      public Object call(HigsonContext ctx, Object[] args)
      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:
      call in class UtilFunction
      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.