Class Duration.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Duration.Builder>
com.google.cloud.compute.v1.Duration.Builder
All Implemented Interfaces:
DurationOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Duration

public static final class Duration.Builder extends com.google.protobuf.GeneratedMessage.Builder<Duration.Builder> implements DurationOrBuilder
 A Duration represents a fixed-length span of time represented
 as a count of seconds and fractions of seconds at nanosecond
 resolution. It is independent of any calendar and concepts like "day"
 or "month". Range is approximately 10,000 years.
 
Protobuf type google.cloud.compute.v1.Duration
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
     
    Span of time that's a fraction of a second at nanosecond resolution.
    Span of time at a resolution of a second.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    int
    Span of time that's a fraction of a second at nanosecond resolution.
    long
    Span of time at a resolution of a second.
    boolean
    Span of time that's a fraction of a second at nanosecond resolution.
    boolean
    Span of time at a resolution of a second.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    setNanos(int value)
    Span of time that's a fraction of a second at nanosecond resolution.
    setSeconds(long value)
    Span of time at a resolution of a second.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    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, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

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

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

      public Duration.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.GeneratedMessage.Builder<Duration.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.GeneratedMessage.Builder<Duration.Builder>
    • getDefaultInstanceForType

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

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

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

      public Duration.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<Duration.Builder>
    • mergeFrom

      public Duration.Builder mergeFrom(Duration other)
    • isInitialized

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

      public Duration.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<Duration.Builder>
      Throws:
      IOException
    • hasNanos

      public boolean hasNanos()
       Span of time that's a fraction of a second at nanosecond resolution.
       Durations less than one second are represented with a 0
       `seconds` field and a positive `nanos` field. Must be from 0
       to 999,999,999 inclusive.
       
      optional int32 nanos = 104586303;
      Specified by:
      hasNanos in interface DurationOrBuilder
      Returns:
      Whether the nanos field is set.
    • getNanos

      public int getNanos()
       Span of time that's a fraction of a second at nanosecond resolution.
       Durations less than one second are represented with a 0
       `seconds` field and a positive `nanos` field. Must be from 0
       to 999,999,999 inclusive.
       
      optional int32 nanos = 104586303;
      Specified by:
      getNanos in interface DurationOrBuilder
      Returns:
      The nanos.
    • setNanos

      public Duration.Builder setNanos(int value)
       Span of time that's a fraction of a second at nanosecond resolution.
       Durations less than one second are represented with a 0
       `seconds` field and a positive `nanos` field. Must be from 0
       to 999,999,999 inclusive.
       
      optional int32 nanos = 104586303;
      Parameters:
      value - The nanos to set.
      Returns:
      This builder for chaining.
    • clearNanos

      public Duration.Builder clearNanos()
       Span of time that's a fraction of a second at nanosecond resolution.
       Durations less than one second are represented with a 0
       `seconds` field and a positive `nanos` field. Must be from 0
       to 999,999,999 inclusive.
       
      optional int32 nanos = 104586303;
      Returns:
      This builder for chaining.
    • hasSeconds

      public boolean hasSeconds()
       Span of time at a resolution of a second. Must be from 0
       to 315,576,000,000 inclusive. Note: these bounds are computed from:
       60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
       
      optional int64 seconds = 359484031;
      Specified by:
      hasSeconds in interface DurationOrBuilder
      Returns:
      Whether the seconds field is set.
    • getSeconds

      public long getSeconds()
       Span of time at a resolution of a second. Must be from 0
       to 315,576,000,000 inclusive. Note: these bounds are computed from:
       60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
       
      optional int64 seconds = 359484031;
      Specified by:
      getSeconds in interface DurationOrBuilder
      Returns:
      The seconds.
    • setSeconds

      public Duration.Builder setSeconds(long value)
       Span of time at a resolution of a second. Must be from 0
       to 315,576,000,000 inclusive. Note: these bounds are computed from:
       60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
       
      optional int64 seconds = 359484031;
      Parameters:
      value - The seconds to set.
      Returns:
      This builder for chaining.
    • clearSeconds

      public Duration.Builder clearSeconds()
       Span of time at a resolution of a second. Must be from 0
       to 315,576,000,000 inclusive. Note: these bounds are computed from:
       60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
       
      optional int64 seconds = 359484031;
      Returns:
      This builder for chaining.