Class Interval

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.Interval

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.
  • Constructor Details

    • Interval

      public Interval()
  • Method Details

    • endTime

      public 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

      public 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.
    • builder

      public static Interval.Builder builder()
      Instantiates a builder for Interval.
    • toBuilder

      public abstract Interval.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static Interval fromJson(String jsonString)
      Deserializes a JSON string to a Interval object.