Class CustomMetric.Builder

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

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

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

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

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

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

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

      public CustomMetric.Builder mergeFrom(CustomMetric other)
    • isInitialized

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

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

      public String getName()
       Identifier. Resource name for this CustomMetric resource.
       Format: properties/{property}/customMetrics/{customMetric}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getName in interface CustomMetricOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
       Identifier. Resource name for this CustomMetric resource.
       Format: properties/{property}/customMetrics/{customMetric}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Specified by:
      getNameBytes in interface CustomMetricOrBuilder
      Returns:
      The bytes for name.
    • setName

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

      public CustomMetric.Builder clearName()
       Identifier. Resource name for this CustomMetric resource.
       Format: properties/{property}/customMetrics/{customMetric}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Returns:
      This builder for chaining.
    • setNameBytes

      public CustomMetric.Builder setNameBytes(com.google.protobuf.ByteString value)
       Identifier. Resource name for this CustomMetric resource.
       Format: properties/{property}/customMetrics/{customMetric}
       
      string name = 1 [(.google.api.field_behavior) = IDENTIFIER];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getParameterName

      public String getParameterName()
       Required. Immutable. Tagging name for this custom metric.
      
       If this is an event-scoped metric, then this is the event parameter
       name.
      
       May only contain alphanumeric and underscore charactes, starting with a
       letter. Max length of 40 characters for event-scoped metrics.
       
      string parameter_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getParameterName in interface CustomMetricOrBuilder
      Returns:
      The parameterName.
    • getParameterNameBytes

      public com.google.protobuf.ByteString getParameterNameBytes()
       Required. Immutable. Tagging name for this custom metric.
      
       If this is an event-scoped metric, then this is the event parameter
       name.
      
       May only contain alphanumeric and underscore charactes, starting with a
       letter. Max length of 40 characters for event-scoped metrics.
       
      string parameter_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getParameterNameBytes in interface CustomMetricOrBuilder
      Returns:
      The bytes for parameterName.
    • setParameterName

      public CustomMetric.Builder setParameterName(String value)
       Required. Immutable. Tagging name for this custom metric.
      
       If this is an event-scoped metric, then this is the event parameter
       name.
      
       May only contain alphanumeric and underscore charactes, starting with a
       letter. Max length of 40 characters for event-scoped metrics.
       
      string parameter_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The parameterName to set.
      Returns:
      This builder for chaining.
    • clearParameterName

      public CustomMetric.Builder clearParameterName()
       Required. Immutable. Tagging name for this custom metric.
      
       If this is an event-scoped metric, then this is the event parameter
       name.
      
       May only contain alphanumeric and underscore charactes, starting with a
       letter. Max length of 40 characters for event-scoped metrics.
       
      string parameter_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Returns:
      This builder for chaining.
    • setParameterNameBytes

      public CustomMetric.Builder setParameterNameBytes(com.google.protobuf.ByteString value)
       Required. Immutable. Tagging name for this custom metric.
      
       If this is an event-scoped metric, then this is the event parameter
       name.
      
       May only contain alphanumeric and underscore charactes, starting with a
       letter. Max length of 40 characters for event-scoped metrics.
       
      string parameter_name = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The bytes for parameterName to set.
      Returns:
      This builder for chaining.
    • getDisplayName

      public String getDisplayName()
       Required. Display name for this custom metric as shown in the Analytics UI.
       Max length of 82 characters, alphanumeric plus space and underscore
       starting with a letter. Legacy system-generated display names may contain
       square brackets, but updates to this field will never permit square
       brackets.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayName in interface CustomMetricOrBuilder
      Returns:
      The displayName.
    • getDisplayNameBytes

      public com.google.protobuf.ByteString getDisplayNameBytes()
       Required. Display name for this custom metric as shown in the Analytics UI.
       Max length of 82 characters, alphanumeric plus space and underscore
       starting with a letter. Legacy system-generated display names may contain
       square brackets, but updates to this field will never permit square
       brackets.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getDisplayNameBytes in interface CustomMetricOrBuilder
      Returns:
      The bytes for displayName.
    • setDisplayName

      public CustomMetric.Builder setDisplayName(String value)
       Required. Display name for this custom metric as shown in the Analytics UI.
       Max length of 82 characters, alphanumeric plus space and underscore
       starting with a letter. Legacy system-generated display names may contain
       square brackets, but updates to this field will never permit square
       brackets.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The displayName to set.
      Returns:
      This builder for chaining.
    • clearDisplayName

      public CustomMetric.Builder clearDisplayName()
       Required. Display name for this custom metric as shown in the Analytics UI.
       Max length of 82 characters, alphanumeric plus space and underscore
       starting with a letter. Legacy system-generated display names may contain
       square brackets, but updates to this field will never permit square
       brackets.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setDisplayNameBytes

      public CustomMetric.Builder setDisplayNameBytes(com.google.protobuf.ByteString value)
       Required. Display name for this custom metric as shown in the Analytics UI.
       Max length of 82 characters, alphanumeric plus space and underscore
       starting with a letter. Legacy system-generated display names may contain
       square brackets, but updates to this field will never permit square
       brackets.
       
      string display_name = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for displayName to set.
      Returns:
      This builder for chaining.
    • getDescription

      public String getDescription()
       Optional. Description for this custom dimension.
       Max length of 150 characters.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescription in interface CustomMetricOrBuilder
      Returns:
      The description.
    • getDescriptionBytes

      public com.google.protobuf.ByteString getDescriptionBytes()
       Optional. Description for this custom dimension.
       Max length of 150 characters.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getDescriptionBytes in interface CustomMetricOrBuilder
      Returns:
      The bytes for description.
    • setDescription

      public CustomMetric.Builder setDescription(String value)
       Optional. Description for this custom dimension.
       Max length of 150 characters.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The description to set.
      Returns:
      This builder for chaining.
    • clearDescription

      public CustomMetric.Builder clearDescription()
       Optional. Description for this custom dimension.
       Max length of 150 characters.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setDescriptionBytes

      public CustomMetric.Builder setDescriptionBytes(com.google.protobuf.ByteString value)
       Optional. Description for this custom dimension.
       Max length of 150 characters.
       
      string description = 4 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for description to set.
      Returns:
      This builder for chaining.
    • getMeasurementUnitValue

      public int getMeasurementUnitValue()
       Required. The type for the custom metric's value.
       
      .google.analytics.admin.v1alpha.CustomMetric.MeasurementUnit measurement_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMeasurementUnitValue in interface CustomMetricOrBuilder
      Returns:
      The enum numeric value on the wire for measurementUnit.
    • setMeasurementUnitValue

      public CustomMetric.Builder setMeasurementUnitValue(int value)
       Required. The type for the custom metric's value.
       
      .google.analytics.admin.v1alpha.CustomMetric.MeasurementUnit measurement_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The enum numeric value on the wire for measurementUnit to set.
      Returns:
      This builder for chaining.
    • getMeasurementUnit

      public CustomMetric.MeasurementUnit getMeasurementUnit()
       Required. The type for the custom metric's value.
       
      .google.analytics.admin.v1alpha.CustomMetric.MeasurementUnit measurement_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getMeasurementUnit in interface CustomMetricOrBuilder
      Returns:
      The measurementUnit.
    • setMeasurementUnit

      public CustomMetric.Builder setMeasurementUnit(CustomMetric.MeasurementUnit value)
       Required. The type for the custom metric's value.
       
      .google.analytics.admin.v1alpha.CustomMetric.MeasurementUnit measurement_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The measurementUnit to set.
      Returns:
      This builder for chaining.
    • clearMeasurementUnit

      public CustomMetric.Builder clearMeasurementUnit()
       Required. The type for the custom metric's value.
       
      .google.analytics.admin.v1alpha.CustomMetric.MeasurementUnit measurement_unit = 5 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • getScopeValue

      public int getScopeValue()
       Required. Immutable. The scope of this custom metric.
       
      .google.analytics.admin.v1alpha.CustomMetric.MetricScope scope = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getScopeValue in interface CustomMetricOrBuilder
      Returns:
      The enum numeric value on the wire for scope.
    • setScopeValue

      public CustomMetric.Builder setScopeValue(int value)
       Required. Immutable. The scope of this custom metric.
       
      .google.analytics.admin.v1alpha.CustomMetric.MetricScope scope = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The enum numeric value on the wire for scope to set.
      Returns:
      This builder for chaining.
    • getScope

      public CustomMetric.MetricScope getScope()
       Required. Immutable. The scope of this custom metric.
       
      .google.analytics.admin.v1alpha.CustomMetric.MetricScope scope = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Specified by:
      getScope in interface CustomMetricOrBuilder
      Returns:
      The scope.
    • setScope

       Required. Immutable. The scope of this custom metric.
       
      .google.analytics.admin.v1alpha.CustomMetric.MetricScope scope = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Parameters:
      value - The scope to set.
      Returns:
      This builder for chaining.
    • clearScope

      public CustomMetric.Builder clearScope()
       Required. Immutable. The scope of this custom metric.
       
      .google.analytics.admin.v1alpha.CustomMetric.MetricScope scope = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
      Returns:
      This builder for chaining.
    • getRestrictedMetricTypeList

      public List<CustomMetric.RestrictedMetricType> getRestrictedMetricTypeList()
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRestrictedMetricTypeList in interface CustomMetricOrBuilder
      Returns:
      A list containing the restrictedMetricType.
    • getRestrictedMetricTypeCount

      public int getRestrictedMetricTypeCount()
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRestrictedMetricTypeCount in interface CustomMetricOrBuilder
      Returns:
      The count of restrictedMetricType.
    • getRestrictedMetricType

      public CustomMetric.RestrictedMetricType getRestrictedMetricType(int index)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRestrictedMetricType in interface CustomMetricOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The restrictedMetricType at the given index.
    • setRestrictedMetricType

      public CustomMetric.Builder setRestrictedMetricType(int index, CustomMetric.RestrictedMetricType value)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      index - The index to set the value at.
      value - The restrictedMetricType to set.
      Returns:
      This builder for chaining.
    • addRestrictedMetricType

      public CustomMetric.Builder addRestrictedMetricType(CustomMetric.RestrictedMetricType value)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • addAllRestrictedMetricType

      public CustomMetric.Builder addAllRestrictedMetricType(Iterable<? extends CustomMetric.RestrictedMetricType> values)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      values - The restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • clearRestrictedMetricType

      public CustomMetric.Builder clearRestrictedMetricType()
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • getRestrictedMetricTypeValueList

      public List<Integer> getRestrictedMetricTypeValueList()
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRestrictedMetricTypeValueList in interface CustomMetricOrBuilder
      Returns:
      A list containing the enum numeric values on the wire for restrictedMetricType.
    • getRestrictedMetricTypeValue

      public int getRestrictedMetricTypeValue(int index)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRestrictedMetricTypeValue in interface CustomMetricOrBuilder
      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 CustomMetric.Builder setRestrictedMetricTypeValue(int index, int value)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      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 CustomMetric.Builder addRestrictedMetricTypeValue(int value)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The enum numeric value on the wire for restrictedMetricType to add.
      Returns:
      This builder for chaining.
    • addAllRestrictedMetricTypeValue

      public CustomMetric.Builder addAllRestrictedMetricTypeValue(Iterable<Integer> values)
       Optional. Types of restricted data that this metric may contain. Required
       for metrics with CURRENCY measurement unit. Must be empty for metrics with
       a non-CURRENCY measurement unit.
       
      repeated .google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType restricted_metric_type = 8 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      values - The enum numeric values on the wire for restrictedMetricType to add.
      Returns:
      This builder for chaining.