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 start time (inclusive) and an end time (exclusive).

The start time must be less than or equal to the end time. When the start equals the end time, the interval is an empty interval. (matches no time) When both start and end are unspecified, the interval matches any time.

  • Constructor Details

    • Interval

      public Interval()
  • Method Details

    • startTime

      public abstract Optional<Instant> startTime()
      The start time of the interval.
    • endTime

      public abstract Optional<Instant> endTime()
      The end time of the interval.
    • 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.