Class F_Instant_Is

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

public class F_Instant_Is extends Object
Moment comparisons, reached as is on an F_Instant.

Both after and before take the other moment in any of the forms InstantBuilder accepts. not() inverts the result, so is.not().before(x) reads as "is at or after x".

There is deliberately no equal. Two instants are equal only to the nanosecond, which is almost never what someone comparing them means, and a comparison that fails on a difference nobody can see looks like bad data rather than a bad question. Say which precision you mean instead, by asking for the elapsed amount in that unit and testing it against zero:

 f().instant.of(a).elapsed.minutes.after(b) == 0   // the same minute
 f().instant.of(a).elapsed.days.after(b) == 0      // the same day
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    F_Instant_Is(Instant instant, boolean negate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    after(Object dateObj, Object timeObj)
    Whether this moment is strictly later than a date and time of day, resolved in the system default zone.
    boolean
    after(Object dateObj, Object timeObj, Object timeZone)
    Whether this moment is strictly later than a date, time of day and explicit zone.
    boolean
    after(String other)
    Whether this moment is strictly later than an ISO-8601 instant string.
    boolean
    after(Instant other)
    Whether this moment is strictly later than an Instant.
    boolean
    Whether this moment is strictly later than a map of date, time and optionally timezone.
    boolean
    before(Object dateObj, Object timeObj)
    Whether this moment is strictly earlier than a date and time of day, resolved in the system default zone.
    boolean
    before(Object dateObj, Object timeObj, Object timeZone)
    Whether this moment is strictly earlier than a date, time of day and explicit zone.
    boolean
    before(String other)
    Whether this moment is strictly earlier than an ISO-8601 instant string.
    boolean
    before(Instant other)
    Whether this moment is strictly earlier than an Instant.
    boolean
    Whether this moment is strictly earlier than a map of date, time and optionally timezone.
    not()
    Inverts the comparison that follows, so is.not().after(x) reads as "is not after x".

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • F_Instant_Is

      public F_Instant_Is(Instant instant, boolean negate)
    • F_Instant_Is

      public F_Instant_Is(Instant instant)
  • Method Details

    • not

      public F_Instant_Is not()
      Inverts the comparison that follows, so is.not().after(x) reads as "is not after x".
      Returns:
      a comparison view with the result negated
    • after

      public boolean after(String other)
      Whether this moment is strictly later than an ISO-8601 instant string.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.after("2026-01-15T00:00:00Z")

      SpEL example:
      #f().instant.now().is.after("2026-01-15T00:00:00Z")
    • after

      public boolean after(Instant other)
      Whether this moment is strictly later than an Instant.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.after(entity.createdDate)

      SpEL example:
      #f().instant.now().is.after(entity.createdDate)
    • after

      public boolean after(Map<String,Object> obj)
      Whether this moment is strictly later than a map of date, time and optionally timezone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.after(['date': '2026-01-15', 'time': '9:00am'])

      SpEL example:
      #f().instant.now().is.after({'date': '2026-01-15', 'time': '9:00am'})
    • after

      public boolean after(Object dateObj, Object timeObj, Object timeZone)
      Whether this moment is strictly later than a date, time of day and explicit zone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.after("2026-01-15", "9:00am", "America/New_York")

      SpEL example:
      #f().instant.now().is.after("2026-01-15", "9:00am", "America/New_York")
    • after

      public boolean after(Object dateObj, Object timeObj)
      Whether this moment is strictly later than a date and time of day, resolved in the system default zone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.after("2026-01-15", "9:00am")

      SpEL example:
      #f().instant.now().is.after("2026-01-15", "9:00am")
    • before

      public boolean before(String other)
      Whether this moment is strictly earlier than an ISO-8601 instant string.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.before("2026-01-15T00:00:00Z")

      SpEL example:
      #f().instant.now().is.before("2026-01-15T00:00:00Z")
    • before

      public boolean before(Instant other)
      Whether this moment is strictly earlier than an Instant.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.before(entity.createdDate)

      SpEL example:
      #f().instant.now().is.before(entity.createdDate)
    • before

      public boolean before(Map<String,Object> obj)
      Whether this moment is strictly earlier than a map of date, time and optionally timezone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.before(['date': '2026-01-15', 'time': '9:00am'])

      SpEL example:
      #f().instant.now().is.before({'date': '2026-01-15', 'time': '9:00am'})
    • before

      public boolean before(Object dateObj, Object timeObj, Object timeZone)
      Whether this moment is strictly earlier than a date, time of day and explicit zone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.before("2026-01-15", "9:00am", "America/New_York")

      SpEL example:
      #f().instant.now().is.before("2026-01-15", "9:00am", "America/New_York")
    • before

      public boolean before(Object dateObj, Object timeObj)
      Whether this moment is strictly earlier than a date and time of day, resolved in the system default zone.
      Returns:
      true if it is, or the opposite after not()

      Groovy example:
      f().instant.now().is.before("2026-01-15", "9:00am")

      SpEL example:
      #f().instant.now().is.before("2026-01-15", "9:00am")