Class InstantBuilder

java.lang.Object
com.ssgllc.fish.f.instant.InstantBuilder

public class InstantBuilder extends Object
Builds an absolute moment to start an f().instant chain.

Reached as a field: f().instant. Unlike f().date and f().time, a moment here is a fixed point on the timeline, so assembling one from a local date and time needs a zone - pass it explicitly wherever it matters, since the default is the server's.

  • Constructor Details

    • InstantBuilder

      public InstantBuilder()
  • Method Details

    • of

      public F_Instant of(String instant)
      A moment parsed from an ISO-8601 instant string, which must carry a zone or offset.
      Parameters:
      instant - the value to parse, e.g. "2026-01-15T14:30:00Z"
      Returns:
      a moment to continue the chain from

      Groovy example:
      f().instant.of("2026-01-15T14:30:00Z").toIso()

      Returns:
      "2026-01-15T14:30:00Z"

      SpEL example:
      #f().instant.of("2026-01-15T14:30:00Z").toIso()
    • of

      public F_Instant of(Instant instant)
      A moment from an Instant - the overload to use when an entity field is already a timestamp.
      Parameters:
      instant - the value to wrap
      Returns:
      a moment to continue the chain from

      Groovy example:
      f().instant.of(entity.createdDate).format("MM/dd/yyyy h:mm a")

      Returns:
      "01/15/2026 9:30 AM"

      SpEL example:
      #f().instant.of(entity.createdDate).format("MM/dd/yyyy h:mm a")
    • of

      public F_Instant of(Map<String,Object> obj)
      A moment assembled from a map of date, time and timezone. The map form of of(Object, Object, Object); timezone may be omitted, in which case the system default zone is used.
      Parameters:
      obj - map carrying date, time and optionally timezone
      Returns:
      a moment to continue the chain from

      Groovy example:
      f().instant.of(['date': f().date.today(), 'time': f().time.of('2:30pm'), 'timezone': 'America/New_York']).toIso()

      Returns:
      that local time as an absolute moment

      SpEL example:
      #f().instant.of({'date': #f().date.today(), 'time': #f().time.of('2:30pm'), 'timezone': 'America/New_York'}).toIso()
    • of

      public F_Instant of(Object dateObj, Object timeObj, Object timeZone)
      A moment assembled from a date, a time of day and a zone - the way to turn a local wall-clock time into an absolute instant.

      dateObj accepts a LocalDate, an f() date or an ISO-8601 date string; timeObj an f() time or a string PlainTimeBuilder.of(String) understands. Only the hour and minute of the time are used. A null zone means the system default.

      Parameters:
      dateObj - the calendar date
      timeObj - the time of day
      timeZone - the zone id, e.g. "America/New_York"; null for the system default
      Returns:
      a moment to continue the chain from

      Groovy example:
      f().instant.of("2026-01-15", "2:30pm", "America/New_York").toIso()

      Returns:
      "2026-01-15T19:30:00Z"

      SpEL example:
      #f().instant.of("2026-01-15", "2:30pm", "America/New_York").toIso()
    • of

      public F_Instant of(Object dateObj, Object timeObj)
      A moment from a date and a time of day, in the system default zone. See of(Object, Object, Object) for the accepted forms and to supply a zone explicitly - worth doing wherever the result crosses a system boundary, since the server zone is not the user's.
      Parameters:
      dateObj - the calendar date
      timeObj - the time of day
      Returns:
      a moment to continue the chain from

      Groovy example:
      f().instant.of("2026-01-15", "2:30pm").toIso()

      Returns:
      that local time in the server zone, as an absolute moment

      SpEL example:
      #f().instant.of("2026-01-15", "2:30pm").toIso()
    • now

      public F_Instant now()
      The current moment.
      Returns:
      now, as a moment to continue the chain from

      Groovy example:
      f().instant.now().toIso()

      Returns:
      "2026-08-21T13:45:12.335Z"

      SpEL example:
      #f().instant.now().toIso()