Class CustomMetric.Builder (0.56.0)

public static final class CustomMetric.Builder extends GeneratedMessageV3.Builder<CustomMetric.Builder> implements CustomMetricOrBuilder

A definition for a custom metric.

Protobuf type google.analytics.admin.v1alpha.CustomMetric

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllRestrictedMetricType(Iterable<? extends CustomMetric.RestrictedMetricType> values)

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];

Parameter
Name Description
values Iterable<? extends com.google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType>

The restrictedMetricType to add.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

addAllRestrictedMetricTypeValue(Iterable<Integer> values)

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];

Parameter
Name Description
values Iterable<Integer>

The enum numeric values on the wire for restrictedMetricType to add.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CustomMetric.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CustomMetric.Builder
Overrides

addRestrictedMetricType(CustomMetric.RestrictedMetricType value)

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];

Parameter
Name Description
value CustomMetric.RestrictedMetricType

The restrictedMetricType to add.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

addRestrictedMetricTypeValue(int value)

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];

Parameter
Name Description
value int

The enum numeric value on the wire for restrictedMetricType to add.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

build()

public CustomMetric build()
Returns
Type Description
CustomMetric

buildPartial()

public CustomMetric buildPartial()
Returns
Type Description
CustomMetric

clear()

public CustomMetric.Builder clear()
Returns
Type Description
CustomMetric.Builder
Overrides

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
Type Description
CustomMetric.Builder

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
Type Description
CustomMetric.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CustomMetric.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
CustomMetric.Builder
Overrides

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
Type Description
CustomMetric.Builder

This builder for chaining.

clearName()

public CustomMetric.Builder clearName()

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CustomMetric.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
CustomMetric.Builder
Overrides

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
Type Description
CustomMetric.Builder

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
Type Description
CustomMetric.Builder

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
Type Description
CustomMetric.Builder

This builder for chaining.

clone()

public CustomMetric.Builder clone()
Returns
Type Description
CustomMetric.Builder
Overrides

getDefaultInstanceForType()

public CustomMetric getDefaultInstanceForType()
Returns
Type Description
CustomMetric

getDescription()

public String getDescription()

Optional. Description for this custom dimension. Max length of 150 characters.

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. Description for this custom dimension. Max length of 150 characters.

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public 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];

Returns
Type Description
ByteString

The bytes for displayName.

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];

Returns
Type Description
CustomMetric.MeasurementUnit

The measurementUnit.

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];

Returns
Type Description
int

The enum numeric value on the wire for measurementUnit.

getName()

public String getName()

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

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];

Returns
Type Description
String

The parameterName.

getParameterNameBytes()

public 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];

Returns
Type Description
ByteString

The bytes for parameterName.

getRestrictedMetricType(int index)

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];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
CustomMetric.RestrictedMetricType

The restrictedMetricType at the given index.

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];

Returns
Type Description
int

The count of restrictedMetricType.

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];

Returns
Type Description
List<RestrictedMetricType>

A list containing the restrictedMetricType.

getRestrictedMetricTypeValue(int index)

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];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of restrictedMetricType at the given index.

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];

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for restrictedMetricType.

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];

Returns
Type Description
CustomMetric.MetricScope

The scope.

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];

Returns
Type Description
int

The enum numeric value on the wire for scope.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CustomMetric other)

public CustomMetric.Builder mergeFrom(CustomMetric other)
Parameter
Name Description
other CustomMetric
Returns
Type Description
CustomMetric.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CustomMetric.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CustomMetric.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public CustomMetric.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
CustomMetric.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CustomMetric.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CustomMetric.Builder
Overrides

setDescription(String value)

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];

Parameter
Name Description
value String

The description to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setDescriptionBytes(ByteString value)

public CustomMetric.Builder setDescriptionBytes(ByteString value)

Optional. Description for this custom dimension. Max length of 150 characters.

string description = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for description to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setDisplayName(String value)

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];

Parameter
Name Description
value String

The displayName to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setDisplayNameBytes(ByteString value)

public CustomMetric.Builder setDisplayNameBytes(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];

Parameter
Name Description
value ByteString

The bytes for displayName to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CustomMetric.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
CustomMetric.Builder
Overrides

setMeasurementUnit(CustomMetric.MeasurementUnit value)

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];

Parameter
Name Description
value CustomMetric.MeasurementUnit

The measurementUnit to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setMeasurementUnitValue(int value)

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];

Parameter
Name Description
value int

The enum numeric value on the wire for measurementUnit to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setName(String value)

public CustomMetric.Builder setName(String value)

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value String

The name to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setNameBytes(ByteString value)

public CustomMetric.Builder setNameBytes(ByteString value)

Output only. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setParameterName(String value)

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];

Parameter
Name Description
value String

The parameterName to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setParameterNameBytes(ByteString value)

public CustomMetric.Builder setParameterNameBytes(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];

Parameter
Name Description
value ByteString

The bytes for parameterName to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public CustomMetric.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
CustomMetric.Builder
Overrides

setRestrictedMetricType(int index, CustomMetric.RestrictedMetricType value)

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
Name Description
index int

The index to set the value at.

value CustomMetric.RestrictedMetricType

The restrictedMetricType to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setRestrictedMetricTypeValue(int index, int value)

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
Name Description
index int

The index to set the value at.

value int

The enum numeric value on the wire for restrictedMetricType to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setScope(CustomMetric.MetricScope value)

public CustomMetric.Builder setScope(CustomMetric.MetricScope 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];

Parameter
Name Description
value CustomMetric.MetricScope

The scope to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setScopeValue(int value)

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];

Parameter
Name Description
value int

The enum numeric value on the wire for scope to set.

Returns
Type Description
CustomMetric.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CustomMetric.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
CustomMetric.Builder
Overrides