Class Distribution.Builder

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

    public static final class Distribution.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Distribution.Builder>
    implements DistributionOrBuilder
     `Distribution` contains summary statistics for a population of values. It
     optionally contains a histogram representing the distribution of those values
     across a set of buckets.
     The summary statistics are the count, mean, sum of the squared deviation from
     the mean, the minimum, and the maximum of the set of population of values.
     The histogram is based on a sequence of buckets and gives a count of values
     that fall into each bucket. The boundaries of the buckets are given either
     explicitly or by formulas for buckets of fixed or exponentially increasing
     widths.
     Although it is not forbidden, it is generally a bad idea to include
     non-finite values (infinities or NaNs) in the population of values, as this
     will render the `mean` and `sum_of_squared_deviation` fields meaningless.
     
    Protobuf type google.api.Distribution
    • 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<Distribution.Builder>
      • clear

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

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

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

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

        public Distribution.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<Distribution.Builder>
      • setField

        public Distribution.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<Distribution.Builder>
      • clearField

        public Distribution.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<Distribution.Builder>
      • clearOneof

        public Distribution.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<Distribution.Builder>
      • setRepeatedField

        public Distribution.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<Distribution.Builder>
      • addRepeatedField

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

        public Distribution.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<Distribution.Builder>
      • isInitialized

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

        public Distribution.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<Distribution.Builder>
        Throws:
        IOException
      • getCount

        public long getCount()
         The number of values in the population. Must be non-negative. This value
         must equal the sum of the values in `bucket_counts` if a histogram is
         provided.
         
        int64 count = 1;
        Specified by:
        getCount in interface DistributionOrBuilder
        Returns:
        The count.
      • setCount

        public Distribution.Builder setCount​(long value)
         The number of values in the population. Must be non-negative. This value
         must equal the sum of the values in `bucket_counts` if a histogram is
         provided.
         
        int64 count = 1;
        Parameters:
        value - The count to set.
        Returns:
        This builder for chaining.
      • clearCount

        public Distribution.Builder clearCount()
         The number of values in the population. Must be non-negative. This value
         must equal the sum of the values in `bucket_counts` if a histogram is
         provided.
         
        int64 count = 1;
        Returns:
        This builder for chaining.
      • getMean

        public double getMean()
         The arithmetic mean of the values in the population. If `count` is zero
         then this field must be zero.
         
        double mean = 2;
        Specified by:
        getMean in interface DistributionOrBuilder
        Returns:
        The mean.
      • setMean

        public Distribution.Builder setMean​(double value)
         The arithmetic mean of the values in the population. If `count` is zero
         then this field must be zero.
         
        double mean = 2;
        Parameters:
        value - The mean to set.
        Returns:
        This builder for chaining.
      • clearMean

        public Distribution.Builder clearMean()
         The arithmetic mean of the values in the population. If `count` is zero
         then this field must be zero.
         
        double mean = 2;
        Returns:
        This builder for chaining.
      • getSumOfSquaredDeviation

        public double getSumOfSquaredDeviation()
         The sum of squared deviations from the mean of the values in the
         population. For values x_i this is:
             Sum[i=1..n]((x_i - mean)^2)
         Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
         describes Welford's method for accumulating this sum in one pass.
         If `count` is zero then this field must be zero.
         
        double sum_of_squared_deviation = 3;
        Specified by:
        getSumOfSquaredDeviation in interface DistributionOrBuilder
        Returns:
        The sumOfSquaredDeviation.
      • setSumOfSquaredDeviation

        public Distribution.Builder setSumOfSquaredDeviation​(double value)
         The sum of squared deviations from the mean of the values in the
         population. For values x_i this is:
             Sum[i=1..n]((x_i - mean)^2)
         Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
         describes Welford's method for accumulating this sum in one pass.
         If `count` is zero then this field must be zero.
         
        double sum_of_squared_deviation = 3;
        Parameters:
        value - The sumOfSquaredDeviation to set.
        Returns:
        This builder for chaining.
      • clearSumOfSquaredDeviation

        public Distribution.Builder clearSumOfSquaredDeviation()
         The sum of squared deviations from the mean of the values in the
         population. For values x_i this is:
             Sum[i=1..n]((x_i - mean)^2)
         Knuth, "The Art of Computer Programming", Vol. 2, page 232, 3rd edition
         describes Welford's method for accumulating this sum in one pass.
         If `count` is zero then this field must be zero.
         
        double sum_of_squared_deviation = 3;
        Returns:
        This builder for chaining.
      • hasRange

        public boolean hasRange()
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
        Specified by:
        hasRange in interface DistributionOrBuilder
        Returns:
        Whether the range field is set.
      • getRange

        public Distribution.Range getRange()
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
        Specified by:
        getRange in interface DistributionOrBuilder
        Returns:
        The range.
      • setRange

        public Distribution.Builder setRange​(Distribution.Range value)
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
      • setRange

        public Distribution.Builder setRange​(Distribution.Range.Builder builderForValue)
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
      • mergeRange

        public Distribution.Builder mergeRange​(Distribution.Range value)
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
      • clearRange

        public Distribution.Builder clearRange()
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
      • getRangeBuilder

        public Distribution.Range.Builder getRangeBuilder()
         If specified, contains the range of the population values. The field
         must not be present if the `count` is zero.
         
        .google.api.Distribution.Range range = 4;
      • hasBucketOptions

        public boolean hasBucketOptions()
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
        Specified by:
        hasBucketOptions in interface DistributionOrBuilder
        Returns:
        Whether the bucketOptions field is set.
      • getBucketOptions

        public Distribution.BucketOptions getBucketOptions()
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
        Specified by:
        getBucketOptions in interface DistributionOrBuilder
        Returns:
        The bucketOptions.
      • setBucketOptions

        public Distribution.Builder setBucketOptions​(Distribution.BucketOptions value)
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
      • setBucketOptions

        public Distribution.Builder setBucketOptions​(Distribution.BucketOptions.Builder builderForValue)
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
      • mergeBucketOptions

        public Distribution.Builder mergeBucketOptions​(Distribution.BucketOptions value)
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
      • clearBucketOptions

        public Distribution.Builder clearBucketOptions()
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
      • getBucketOptionsBuilder

        public Distribution.BucketOptions.Builder getBucketOptionsBuilder()
         Defines the histogram bucket boundaries. If the distribution does not
         contain a histogram, then omit this field.
         
        .google.api.Distribution.BucketOptions bucket_options = 6;
      • getBucketCountsList

        public List<Long> getBucketCountsList()
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Specified by:
        getBucketCountsList in interface DistributionOrBuilder
        Returns:
        A list containing the bucketCounts.
      • getBucketCountsCount

        public int getBucketCountsCount()
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Specified by:
        getBucketCountsCount in interface DistributionOrBuilder
        Returns:
        The count of bucketCounts.
      • getBucketCounts

        public long getBucketCounts​(int index)
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Specified by:
        getBucketCounts in interface DistributionOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The bucketCounts at the given index.
      • setBucketCounts

        public Distribution.Builder setBucketCounts​(int index,
                                                    long value)
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Parameters:
        index - The index to set the value at.
        value - The bucketCounts to set.
        Returns:
        This builder for chaining.
      • addBucketCounts

        public Distribution.Builder addBucketCounts​(long value)
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Parameters:
        value - The bucketCounts to add.
        Returns:
        This builder for chaining.
      • addAllBucketCounts

        public Distribution.Builder addAllBucketCounts​(Iterable<? extends Long> values)
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Parameters:
        values - The bucketCounts to add.
        Returns:
        This builder for chaining.
      • clearBucketCounts

        public Distribution.Builder clearBucketCounts()
         The number of values in each bucket of the histogram, as described in
         `bucket_options`. If the distribution does not have a histogram, then omit
         this field. If there is a histogram, then the sum of the values in
         `bucket_counts` must equal the value in the `count` field of the
         distribution.
         If present, `bucket_counts` should contain N values, where N is the number
         of buckets specified in `bucket_options`. If you supply fewer than N
         values, the remaining values are assumed to be 0.
         The order of the values in `bucket_counts` follows the bucket numbering
         schemes described for the three bucket types. The first value must be the
         count for the underflow bucket (number 0). The next N-2 values are the
         counts for the finite buckets (number 1 through N-2). The N'th value in
         `bucket_counts` is the count for the overflow bucket (number N-1).
         
        repeated int64 bucket_counts = 7;
        Returns:
        This builder for chaining.
      • getExemplarsCount

        public int getExemplarsCount()
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
        Specified by:
        getExemplarsCount in interface DistributionOrBuilder
      • setExemplars

        public Distribution.Builder setExemplars​(int index,
                                                 Distribution.Exemplar value)
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • addExemplars

        public Distribution.Builder addExemplars​(int index,
                                                 Distribution.Exemplar value)
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • clearExemplars

        public Distribution.Builder clearExemplars()
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • removeExemplars

        public Distribution.Builder removeExemplars​(int index)
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • getExemplarsBuilder

        public Distribution.Exemplar.Builder getExemplarsBuilder​(int index)
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • addExemplarsBuilder

        public Distribution.Exemplar.Builder addExemplarsBuilder()
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • addExemplarsBuilder

        public Distribution.Exemplar.Builder addExemplarsBuilder​(int index)
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • getExemplarsBuilderList

        public List<Distribution.Exemplar.Builder> getExemplarsBuilderList()
         Must be in increasing order of `value` field.
         
        repeated .google.api.Distribution.Exemplar exemplars = 10;
      • setUnknownFields

        public final Distribution.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<Distribution.Builder>
      • mergeUnknownFields

        public final Distribution.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<Distribution.Builder>