Class CalculatedMetric.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CalculatedMetric.Builder>
com.google.analytics.admin.v1alpha.CalculatedMetric.Builder
All Implemented Interfaces:
CalculatedMetricOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CalculatedMetric

public static final class CalculatedMetric.Builder extends com.google.protobuf.GeneratedMessage.Builder<CalculatedMetric.Builder> implements CalculatedMetricOrBuilder
 A definition for a calculated metric.
 
Protobuf type google.analytics.admin.v1alpha.CalculatedMetric
  • 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<CalculatedMetric.Builder>
    • clear

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

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

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

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

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

      public CalculatedMetric.Builder mergeFrom(CalculatedMetric other)
    • isInitialized

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

      public CalculatedMetric.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<CalculatedMetric.Builder>
      Throws:
      IOException
    • getName

      public String getName()
       Identifier. Resource name for this CalculatedMetric.
       Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface CalculatedMetricOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Identifier. Resource name for this CalculatedMetric.
       Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface CalculatedMetricOrBuilder
      Returns:
      The bytes for name.
    • setName

      public CalculatedMetric.Builder setName(String value)
       Identifier. Resource name for this CalculatedMetric.
       Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public CalculatedMetric.Builder clearName()
       Identifier. Resource name for this CalculatedMetric.
       Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Returns:
      This builder for chaining.
    • setNameBytes

      public CalculatedMetric.Builder setNameBytes(com.google.protobuf.ByteString value)
       Identifier. Resource name for this CalculatedMetric.
       Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getDescription

      public String getDescription()
       Optional. Description for this calculated metric.
       Max length of 4096 characters.
       
      string description = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescription in interface CalculatedMetricOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Optional. Description for this calculated metric.
       Max length of 4096 characters.
       
      string description = 2 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescriptionBytes in interface CalculatedMetricOrBuilder
      Returns:
      The bytes for description.
    • setDescription

      public CalculatedMetric.Builder setDescription(String value)
       Optional. Description for this calculated metric.
       Max length of 4096 characters.
       
      string description = 2 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The description to set.
      Returns:
      This builder for chaining.
    • clearDescription

      public CalculatedMetric.Builder clearDescription()
       Optional. Description for this calculated metric.
       Max length of 4096 characters.
       
      string description = 2 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setDescriptionBytes

      public CalculatedMetric.Builder setDescriptionBytes(com.google.protobuf.ByteString value)
       Optional. Description for this calculated metric.
       Max length of 4096 characters.
       
      string description = 2 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for description to set.
      Returns:
      This builder for chaining.
    • getDisplayName

      public String getDisplayName()
       Required. Display name for this calculated metric as shown in the
       Google Analytics UI. Max length 82 characters.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayName in interface CalculatedMetricOrBuilder
      Returns:
      The displayName.
    • getDisplayNameBytes

      public com.google.protobuf.ByteString getDisplayNameBytes()
       Required. Display name for this calculated metric as shown in the
       Google Analytics UI. Max length 82 characters.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayNameBytes in interface CalculatedMetricOrBuilder
      Returns:
      The bytes for displayName.
    • setDisplayName

      public CalculatedMetric.Builder setDisplayName(String value)
       Required. Display name for this calculated metric as shown in the
       Google Analytics UI. Max length 82 characters.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The displayName to set.
      Returns:
      This builder for chaining.
    • clearDisplayName

      public CalculatedMetric.Builder clearDisplayName()
       Required. Display name for this calculated metric as shown in the
       Google Analytics UI. Max length 82 characters.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setDisplayNameBytes

      public CalculatedMetric.Builder setDisplayNameBytes(com.google.protobuf.ByteString value)
       Required. Display name for this calculated metric as shown in the
       Google Analytics UI. Max length 82 characters.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for displayName to set.
      Returns:
      This builder for chaining.
    • getCalculatedMetricId

      public String getCalculatedMetricId()
       Output only. The ID to use for the calculated metric. In the UI, this is
       referred to as the "API name."
      
       The calculated_metric_id is used when referencing this calculated metric
       from external APIs. For example, "calcMetric:{calculated_metric_id}".
       
      string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCalculatedMetricId in interface CalculatedMetricOrBuilder
      Returns:
      The calculatedMetricId.
    • getCalculatedMetricIdBytes

      public com.google.protobuf.ByteString getCalculatedMetricIdBytes()
       Output only. The ID to use for the calculated metric. In the UI, this is
       referred to as the "API name."
      
       The calculated_metric_id is used when referencing this calculated metric
       from external APIs. For example, "calcMetric:{calculated_metric_id}".
       
      string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getCalculatedMetricIdBytes in interface CalculatedMetricOrBuilder
      Returns:
      The bytes for calculatedMetricId.
    • setCalculatedMetricId

      public CalculatedMetric.Builder setCalculatedMetricId(String value)
       Output only. The ID to use for the calculated metric. In the UI, this is
       referred to as the "API name."
      
       The calculated_metric_id is used when referencing this calculated metric
       from external APIs. For example, "calcMetric:{calculated_metric_id}".
       
      string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The calculatedMetricId to set.
      Returns:
      This builder for chaining.
    • clearCalculatedMetricId

      public CalculatedMetric.Builder clearCalculatedMetricId()
       Output only. The ID to use for the calculated metric. In the UI, this is
       referred to as the "API name."
      
       The calculated_metric_id is used when referencing this calculated metric
       from external APIs. For example, "calcMetric:{calculated_metric_id}".
       
      string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • setCalculatedMetricIdBytes

      public CalculatedMetric.Builder setCalculatedMetricIdBytes(com.google.protobuf.ByteString value)
       Output only. The ID to use for the calculated metric. In the UI, this is
       referred to as the "API name."
      
       The calculated_metric_id is used when referencing this calculated metric
       from external APIs. For example, "calcMetric:{calculated_metric_id}".
       
      string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The bytes for calculatedMetricId to set.
      Returns:
      This builder for chaining.
    • getMetricUnitValue

      public int getMetricUnitValue()
       Required. The type for the calculated metric's value.
       
      .google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMetricUnitValue in interface CalculatedMetricOrBuilder
      Returns:
      The enum numeric value on the wire for metricUnit.
    • setMetricUnitValue

      public CalculatedMetric.Builder setMetricUnitValue(int value)
       Required. The type for the calculated metric's value.
       
      .google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enum numeric value on the wire for metricUnit to set.
      Returns:
      This builder for chaining.
    • getMetricUnit

      public CalculatedMetric.MetricUnit getMetricUnit()
       Required. The type for the calculated metric's value.
       
      .google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMetricUnit in interface CalculatedMetricOrBuilder
      Returns:
      The metricUnit.
    • setMetricUnit

       Required. The type for the calculated metric's value.
       
      .google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The metricUnit to set.
      Returns:
      This builder for chaining.
    • clearMetricUnit

      public CalculatedMetric.Builder clearMetricUnit()
       Required. The type for the calculated metric's value.
       
      .google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getRestrictedMetricTypeList

      public List<CalculatedMetric.RestrictedMetricType> getRestrictedMetricTypeList()
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRestrictedMetricTypeList in interface CalculatedMetricOrBuilder
      Returns:
      A list containing the restrictedMetricType.
    • getRestrictedMetricTypeCount

      public int getRestrictedMetricTypeCount()
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRestrictedMetricTypeCount in interface CalculatedMetricOrBuilder
      Returns:
      The count of restrictedMetricType.
    • getRestrictedMetricType

      public CalculatedMetric.RestrictedMetricType getRestrictedMetricType(int index)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRestrictedMetricType in interface CalculatedMetricOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The restrictedMetricType at the given index.
    • setRestrictedMetricType

      public CalculatedMetric.Builder setRestrictedMetricType(int index, CalculatedMetric.RestrictedMetricType value)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      index - The index to set the value at.
      value - The restrictedMetricType to set.
      Returns:
      This builder for chaining.
    • addRestrictedMetricType

      public CalculatedMetric.Builder addRestrictedMetricType(CalculatedMetric.RestrictedMetricType value)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • addAllRestrictedMetricType

      public CalculatedMetric.Builder addAllRestrictedMetricType(Iterable<? extends CalculatedMetric.RestrictedMetricType> values)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      values - The restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • clearRestrictedMetricType

      public CalculatedMetric.Builder clearRestrictedMetricType()
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.
    • getRestrictedMetricTypeValueList

      public List<Integer> getRestrictedMetricTypeValueList()
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRestrictedMetricTypeValueList in interface CalculatedMetricOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for restrictedMetricType.
    • getRestrictedMetricTypeValue

      public int getRestrictedMetricTypeValue(int index)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getRestrictedMetricTypeValue in interface CalculatedMetricOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The enum numeric value on the wire of restrictedMetricType at the given index.
    • setRestrictedMetricTypeValue

      public CalculatedMetric.Builder setRestrictedMetricTypeValue(int index, int value)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      index - The index to set the value at.
      value - The enum numeric value on the wire for restrictedMetricType to set.
      Returns:
      This builder for chaining.
    • addRestrictedMetricTypeValue

      public CalculatedMetric.Builder addRestrictedMetricTypeValue(int value)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The enum numeric value on the wire for restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • addAllRestrictedMetricTypeValue

      public CalculatedMetric.Builder addAllRestrictedMetricTypeValue(Iterable<Integer> values)
       Output only. Types of restricted data that this metric contains.
       
      repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      values - The enum numeric values on the wire for restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • getFormula

      public String getFormula()
       Required. The calculated metric's definition. Maximum number of unique
       referenced custom metrics is 5. Formulas supports the following operations:
       + (addition),  - (subtraction), - (negative),  * (multiplication), /
       (division), () (parenthesis). Any valid real numbers are acceptable that
       fit in a Long (64bit integer) or a Double (64 bit floating point number).
       Example formula:
       "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
       
      string formula = 7 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getFormula in interface CalculatedMetricOrBuilder
      Returns:
      The formula.
    • getFormulaBytes

      public com.google.protobuf.ByteString getFormulaBytes()
       Required. The calculated metric's definition. Maximum number of unique
       referenced custom metrics is 5. Formulas supports the following operations:
       + (addition),  - (subtraction), - (negative),  * (multiplication), /
       (division), () (parenthesis). Any valid real numbers are acceptable that
       fit in a Long (64bit integer) or a Double (64 bit floating point number).
       Example formula:
       "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
       
      string formula = 7 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getFormulaBytes in interface CalculatedMetricOrBuilder
      Returns:
      The bytes for formula.
    • setFormula

      public CalculatedMetric.Builder setFormula(String value)
       Required. The calculated metric's definition. Maximum number of unique
       referenced custom metrics is 5. Formulas supports the following operations:
       + (addition),  - (subtraction), - (negative),  * (multiplication), /
       (division), () (parenthesis). Any valid real numbers are acceptable that
       fit in a Long (64bit integer) or a Double (64 bit floating point number).
       Example formula:
       "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
       
      string formula = 7 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The formula to set.
      Returns:
      This builder for chaining.
    • clearFormula

      public CalculatedMetric.Builder clearFormula()
       Required. The calculated metric's definition. Maximum number of unique
       referenced custom metrics is 5. Formulas supports the following operations:
       + (addition),  - (subtraction), - (negative),  * (multiplication), /
       (division), () (parenthesis). Any valid real numbers are acceptable that
       fit in a Long (64bit integer) or a Double (64 bit floating point number).
       Example formula:
       "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
       
      string formula = 7 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setFormulaBytes

      public CalculatedMetric.Builder setFormulaBytes(com.google.protobuf.ByteString value)
       Required. The calculated metric's definition. Maximum number of unique
       referenced custom metrics is 5. Formulas supports the following operations:
       + (addition),  - (subtraction), - (negative),  * (multiplication), /
       (division), () (parenthesis). Any valid real numbers are acceptable that
       fit in a Long (64bit integer) or a Double (64 bit floating point number).
       Example formula:
       "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
       
      string formula = 7 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for formula to set.
      Returns:
      This builder for chaining.
    • getInvalidMetricReference

      public boolean getInvalidMetricReference()
       Output only. If true, this calculated metric has a invalid metric
       reference. Anything using a calculated metric with invalid_metric_reference
       set to true may fail, produce warnings, or produce unexpected results.
       
      bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Specified by:
      getInvalidMetricReference in interface CalculatedMetricOrBuilder
      Returns:
      The invalidMetricReference.
    • setInvalidMetricReference

      public CalculatedMetric.Builder setInvalidMetricReference(boolean value)
       Output only. If true, this calculated metric has a invalid metric
       reference. Anything using a calculated metric with invalid_metric_reference
       set to true may fail, produce warnings, or produce unexpected results.
       
      bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Parameters:
      value - The invalidMetricReference to set.
      Returns:
      This builder for chaining.
    • clearInvalidMetricReference

      public CalculatedMetric.Builder clearInvalidMetricReference()
       Output only. If true, this calculated metric has a invalid metric
       reference. Anything using a calculated metric with invalid_metric_reference
       set to true may fail, produce warnings, or produce unexpected results.
       
      bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];
      Returns:
      This builder for chaining.