Package com.google.genai.types
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 classInterval.BuilderBuilder for Interval.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description Interval()
-
Method Summary
Modifier and Type Method Description abstract Optional<Instant>endTime()Optional. abstract Optional<Instant>startTime()Optional. static Interval.Builderbuilder()Instantiates a builder for Interval. abstract Interval.BuildertoBuilder()Creates a builder with the same values as this instance. static IntervalfromJson(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
-
-
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.
-
builder
static Interval.Builder builder()
Instantiates a builder for Interval.
-
toBuilder
abstract Interval.Builder toBuilder()
Creates a builder with the same values as this instance.
-
-
-
-