Class TimeInterval.Builder

  • All Implemented Interfaces:
    TimeIntervalOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    TimeInterval

    public static final class TimeInterval.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
    implements TimeIntervalOrBuilder
     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. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be 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
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • clear

        public TimeInterval.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • getDefaultInstanceForType

        public TimeInterval getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public TimeInterval build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public TimeInterval buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public TimeInterval.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • setField

        public TimeInterval.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                             Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • clearField

        public TimeInterval.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • clearOneof

        public TimeInterval.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • setRepeatedField

        public TimeInterval.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     int index,
                                                     Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • addRepeatedField

        public TimeInterval.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                     Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • mergeFrom

        public TimeInterval.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TimeInterval.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • mergeFrom

        public TimeInterval.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<TimeInterval.Builder>
        Throws:
        IOException
      • hasEndTime

        public boolean hasEndTime()
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
        Specified by:
        hasEndTime in interface TimeIntervalOrBuilder
        Returns:
        Whether the endTime field is set.
      • getEndTime

        public com.google.protobuf.Timestamp getEndTime()
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
        Specified by:
        getEndTime in interface TimeIntervalOrBuilder
        Returns:
        The endTime.
      • setEndTime

        public TimeInterval.Builder setEndTime​(com.google.protobuf.Timestamp value)
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
      • setEndTime

        public TimeInterval.Builder setEndTime​(com.google.protobuf.Timestamp.Builder builderForValue)
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
      • mergeEndTime

        public TimeInterval.Builder mergeEndTime​(com.google.protobuf.Timestamp value)
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
      • clearEndTime

        public TimeInterval.Builder clearEndTime()
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
      • getEndTimeBuilder

        public com.google.protobuf.Timestamp.Builder getEndTimeBuilder()
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
      • getEndTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder()
         Required. The end of the time interval.
         
        .google.protobuf.Timestamp end_time = 2;
        Specified by:
        getEndTimeOrBuilder in interface TimeIntervalOrBuilder
      • hasStartTime

        public 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;
        Specified by:
        hasStartTime in interface TimeIntervalOrBuilder
        Returns:
        Whether the startTime field is set.
      • getStartTime

        public 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;
        Specified by:
        getStartTime in interface TimeIntervalOrBuilder
        Returns:
        The startTime.
      • setStartTime

        public 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;
      • setStartTime

        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;
      • mergeStartTime

        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;
      • clearStartTime

        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;
      • getStartTimeBuilder

        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;
      • getStartTimeOrBuilder

        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;
        Specified by:
        getStartTimeOrBuilder in interface TimeIntervalOrBuilder
      • setUnknownFields

        public final TimeInterval.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>
      • mergeUnknownFields

        public final TimeInterval.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<TimeInterval.Builder>