public static final class TimeInterval.Builder extends com.google.protobuf.GeneratedMessage.Builder<TimeInterval.Builder> implements TimeIntervalOrBuilder
Describes a time interval: * Reads: A half-open time interval. It includes the end time but excludes the start time: `(startTime, endTime]`. The start time must be specified, must be earlier than the end time, and should be no older than the data retention period for the metric. * Writes: A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time, and the end time must not be more than 25 hours in the past or more than five minutes in the future. * For `GAUGE` metrics, the `startTime` value is technically optional; if no value is specified, the start time defaults to the value of the end time, and the interval represents a single point in time. If both start and end times are specified, they must be identical. Such an interval is valid only for `GAUGE` metrics, which are point-in-time measurements. The end time of a new interval must be at least a millisecond after the end time of the previous interval. * For `DELTA` metrics, the start time and end time must specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For `DELTA` metrics, the start time of the next interval must be at least a millisecond after the end time of the previous interval. * For `CUMULATIVE` metrics, the start time and end time must specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. The new start time must be at least a millisecond after the end time of the previous interval. * The start time of a new interval must be at least a millisecond after the end time of the previous interval because intervals are closed. If the start time of a new interval is the same as the end time of the previous interval, then data written at the new start time could overwrite data written at the previous end time.Protobuf type
google.monitoring.v3.TimeInterval| Modifier and Type | Method and Description |
|---|---|
TimeInterval |
build() |
TimeInterval |
buildPartial() |
TimeInterval.Builder |
clear() |
TimeInterval.Builder |
clearEndTime()
Required.
|
TimeInterval.Builder |
clearStartTime()
Optional.
|
TimeInterval |
getDefaultInstanceForType() |
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
com.google.protobuf.Descriptors.Descriptor |
getDescriptorForType() |
com.google.protobuf.Timestamp |
getEndTime()
Required.
|
com.google.protobuf.Timestamp.Builder |
getEndTimeBuilder()
Required.
|
com.google.protobuf.TimestampOrBuilder |
getEndTimeOrBuilder()
Required.
|
com.google.protobuf.Timestamp |
getStartTime()
Optional.
|
com.google.protobuf.Timestamp.Builder |
getStartTimeBuilder()
Optional.
|
com.google.protobuf.TimestampOrBuilder |
getStartTimeOrBuilder()
Optional.
|
boolean |
hasEndTime()
Required.
|
boolean |
hasStartTime()
Optional.
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
TimeInterval.Builder |
mergeEndTime(com.google.protobuf.Timestamp value)
Required.
|
TimeInterval.Builder |
mergeFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
TimeInterval.Builder |
mergeFrom(com.google.protobuf.Message other) |
TimeInterval.Builder |
mergeFrom(TimeInterval other) |
TimeInterval.Builder |
mergeStartTime(com.google.protobuf.Timestamp value)
Optional.
|
TimeInterval.Builder |
setEndTime(com.google.protobuf.Timestamp.Builder builderForValue)
Required.
|
TimeInterval.Builder |
setEndTime(com.google.protobuf.Timestamp value)
Required.
|
TimeInterval.Builder |
setStartTime(com.google.protobuf.Timestamp.Builder builderForValue)
Optional.
|
TimeInterval.Builder |
setStartTime(com.google.protobuf.Timestamp value)
Optional.
|
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringaddAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<TimeInterval.Builder>public TimeInterval.Builder clear()
clear in interface com.google.protobuf.Message.Builderclear in interface com.google.protobuf.MessageLite.Builderclear in class com.google.protobuf.GeneratedMessage.Builder<TimeInterval.Builder>public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
getDescriptorForType in interface com.google.protobuf.Message.BuildergetDescriptorForType in interface com.google.protobuf.MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<TimeInterval.Builder>public TimeInterval getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilderpublic TimeInterval build()
build in interface com.google.protobuf.Message.Builderbuild in interface com.google.protobuf.MessageLite.Builderpublic TimeInterval buildPartial()
buildPartial in interface com.google.protobuf.Message.BuilderbuildPartial in interface com.google.protobuf.MessageLite.Builderpublic TimeInterval.Builder mergeFrom(com.google.protobuf.Message other)
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TimeInterval.Builder>public TimeInterval.Builder mergeFrom(TimeInterval other)
public final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessage.Builder<TimeInterval.Builder>public TimeInterval.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
mergeFrom in interface com.google.protobuf.Message.BuildermergeFrom in interface com.google.protobuf.MessageLite.BuildermergeFrom in class com.google.protobuf.AbstractMessage.Builder<TimeInterval.Builder>IOExceptionpublic boolean hasEndTime()
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;hasEndTime in interface TimeIntervalOrBuilderpublic com.google.protobuf.Timestamp getEndTime()
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;getEndTime in interface TimeIntervalOrBuilderpublic TimeInterval.Builder setEndTime(com.google.protobuf.Timestamp value)
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;public TimeInterval.Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue)
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;public TimeInterval.Builder mergeEndTime(com.google.protobuf.Timestamp value)
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;public TimeInterval.Builder clearEndTime()
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;public com.google.protobuf.Timestamp.Builder getEndTimeBuilder()
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()
Required. The end of the time interval.
.google.protobuf.Timestamp end_time = 2;getEndTimeOrBuilder in interface TimeIntervalOrBuilderpublic boolean hasStartTime()
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;hasStartTime in interface TimeIntervalOrBuilderpublic com.google.protobuf.Timestamp getStartTime()
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;getStartTime in interface TimeIntervalOrBuilderpublic TimeInterval.Builder setStartTime(com.google.protobuf.Timestamp value)
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;public TimeInterval.Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue)
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;public TimeInterval.Builder mergeStartTime(com.google.protobuf.Timestamp value)
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;public TimeInterval.Builder clearStartTime()
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;public com.google.protobuf.Timestamp.Builder getStartTimeBuilder()
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder()
Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.
.google.protobuf.Timestamp start_time = 1;getStartTimeOrBuilder in interface TimeIntervalOrBuilderCopyright © 2026 Google LLC. All rights reserved.