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 Summary
Modifier and TypeMethodDescriptionaddAllRestrictedMetricType(Iterable<? extends CustomMetric.RestrictedMetricType> values) Optional.Optional.Optional.addRestrictedMetricTypeValue(int value) Optional.build()clear()Optional.Required.Required.Identifier.Required.Optional.Required.Optional.com.google.protobuf.ByteStringOptional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorRequired.com.google.protobuf.ByteStringRequired.Required.intRequired.getName()Identifier.com.google.protobuf.ByteStringIdentifier.Required.com.google.protobuf.ByteStringRequired.getRestrictedMetricType(int index) Optional.intOptional.Optional.intgetRestrictedMetricTypeValue(int index) Optional.Optional.getScope()Required.intRequired.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(CustomMetric other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setDescription(String value) Optional.setDescriptionBytes(com.google.protobuf.ByteString value) Optional.setDisplayName(String value) Required.setDisplayNameBytes(com.google.protobuf.ByteString value) Required.Required.setMeasurementUnitValue(int value) Required.Identifier.setNameBytes(com.google.protobuf.ByteString value) Identifier.setParameterName(String value) Required.setParameterNameBytes(com.google.protobuf.ByteString value) Required.setRestrictedMetricType(int index, CustomMetric.RestrictedMetricType value) Optional.setRestrictedMetricTypeValue(int index, int value) Optional.setScope(CustomMetric.MetricScope value) Required.setScopeValue(int value) Required.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<CustomMetric.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<CustomMetric.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<CustomMetric.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CustomMetric.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CustomMetric.Builder>- Throws:
IOException
-
getName
Identifier. Resource name for this CustomMetric resource. Format: properties/{property}/customMetrics/{customMetric}string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Specified by:
getNamein interfaceCustomMetricOrBuilder- 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:
getNameBytesin interfaceCustomMetricOrBuilder- Returns:
- The bytes for name.
-
setName
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
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
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
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:
getParameterNamein interfaceCustomMetricOrBuilder- 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:
getParameterNameBytesin interfaceCustomMetricOrBuilder- Returns:
- The bytes for parameterName.
-
setParameterName
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
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
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
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:
getDisplayNamein interfaceCustomMetricOrBuilder- 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:
getDisplayNameBytesin interfaceCustomMetricOrBuilder- Returns:
- The bytes for displayName.
-
setDisplayName
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
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
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
Optional. Description for this custom dimension. Max length of 150 characters.
string description = 4 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDescriptionin interfaceCustomMetricOrBuilder- 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:
getDescriptionBytesin interfaceCustomMetricOrBuilder- Returns:
- The bytes for description.
-
setDescription
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
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
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:
getMeasurementUnitValuein interfaceCustomMetricOrBuilder- Returns:
- The enum numeric value on the wire for measurementUnit.
-
setMeasurementUnitValue
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
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:
getMeasurementUnitin interfaceCustomMetricOrBuilder- Returns:
- The measurementUnit.
-
setMeasurementUnit
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
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:
getScopeValuein interfaceCustomMetricOrBuilder- Returns:
- The enum numeric value on the wire for scope.
-
setScopeValue
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
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:
getScopein interfaceCustomMetricOrBuilder- 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
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
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:
getRestrictedMetricTypeListin interfaceCustomMetricOrBuilder- 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:
getRestrictedMetricTypeCountin interfaceCustomMetricOrBuilder- Returns:
- The count of restrictedMetricType.
-
getRestrictedMetricType
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:
getRestrictedMetricTypein interfaceCustomMetricOrBuilder- 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
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
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
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:
getRestrictedMetricTypeValueListin interfaceCustomMetricOrBuilder- 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:
getRestrictedMetricTypeValuein interfaceCustomMetricOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The enum numeric value on the wire of restrictedMetricType at the given index.
-
setRestrictedMetricTypeValue
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
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
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.
-