Class CustomMetric.Builder (0.34.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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType>

The restrictedMetricType to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<Integer>

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

Returns
TypeDescription
CustomMetric.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public CustomMetric.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueCustomMetric.RestrictedMetricType

The restrictedMetricType to add.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
CustomMetric.Builder

This builder for chaining.

build()

public CustomMetric build()
Returns
TypeDescription
CustomMetric

buildPartial()

public CustomMetric buildPartial()
Returns
TypeDescription
CustomMetric

clear()

public CustomMetric.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
CustomMetric.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public CustomMetric.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
CustomMetric.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public CustomMetric.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
CustomMetric.Builder

This builder for chaining.

clone()

public CustomMetric.Builder clone()
Returns
TypeDescription
CustomMetric.Builder
Overrides

getDefaultInstanceForType()

public CustomMetric getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for description.

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for scope.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CustomMetric other)

public CustomMetric.Builder mergeFrom(CustomMetric other)
Parameter
NameDescription
otherCustomMetric
Returns
TypeDescription
CustomMetric.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public CustomMetric.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CustomMetric.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public CustomMetric.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
CustomMetric.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final CustomMetric.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueString

The description to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for description to set.

Returns
TypeDescription
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
NameDescription
valueString

The displayName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for displayName to set.

Returns
TypeDescription
CustomMetric.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public CustomMetric.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueCustomMetric.MeasurementUnit

The measurementUnit to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
valueString

The name to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
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
NameDescription
valueString

The parameterName to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for parameterName to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueCustomMetric.RestrictedMetricType

The restrictedMetricType to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueint

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

Returns
TypeDescription
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
NameDescription
valueCustomMetric.MetricScope

The scope to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
CustomMetric.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final CustomMetric.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
CustomMetric.Builder
Overrides