Package com.ssgllc.fish.f.instant
Class InstantBuilder
java.lang.Object
com.ssgllc.fish.f.instant.InstantBuilder
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnow()The current moment.A moment from a date and a time of day, in the system default zone.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.A moment parsed from an ISO-8601 instant string, which must carry a zone or offset.A moment from anInstant- the overload to use when an entity field is already a timestamp.A moment assembled from a map ofdate,timeandtimezone.
-
Constructor Details
-
InstantBuilder
public InstantBuilder()
-
-
Method Details
-
of
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
A moment from anInstant- 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
A moment assembled from a map ofdate,timeandtimezone. The map form ofof(Object, Object, Object);timezonemay be omitted, in which case the system default zone is used.- Parameters:
obj- map carryingdate,timeand optionallytimezone- 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
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.dateObjaccepts aLocalDate, anf()date or an ISO-8601 date string;timeObjanf()time or a stringPlainTimeBuilder.of(String)understands. Only the hour and minute of the time are used. A null zone means the system default.- Parameters:
dateObj- the calendar datetimeObj- the time of daytimeZone- 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
A moment from a date and a time of day, in the system default zone. Seeof(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 datetimeObj- 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
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()
-