Class Interval

  • All Implemented Interfaces:

    
    public abstract class Interval
    extends JsonSerializable
                        

    Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive). The start must be less than or equal to the end. When the start equals the end, the interval is empty (matches no time). When both start and end are unspecified, the interval matches any time.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public abstract class Interval.Builder

      Builder for Interval.

    • Constructor Summary

      Constructors 
      Constructor Description
      Interval()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract Optional<Instant> endTime() Optional.
      abstract Optional<Instant> startTime() Optional.
      static Interval.Builder builder() Instantiates a builder for Interval.
      abstract Interval.Builder toBuilder() Creates a builder with the same values as this instance.
      static Interval fromJson(String jsonString) Deserializes a JSON string to a Interval object.
      • Methods inherited from class com.google.genai.JsonSerializable

        fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString
      • Methods inherited from class java.lang.Object

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

      • Interval

        Interval()
    • Method Detail

      • endTime

         abstract Optional<Instant> endTime()

        Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.

      • startTime

         abstract Optional<Instant> startTime()

        Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.