Class CalculatedMetric.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CalculatedMetric.Builder>
com.google.analytics.admin.v1alpha.CalculatedMetric.Builder
- All Implemented Interfaces:
CalculatedMetricOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- CalculatedMetric
public static final class CalculatedMetric.Builder
extends com.google.protobuf.GeneratedMessage.Builder<CalculatedMetric.Builder>
implements CalculatedMetricOrBuilder
A definition for a calculated metric.Protobuf type
google.analytics.admin.v1alpha.CalculatedMetric-
Method Summary
Modifier and TypeMethodDescriptionaddAllRestrictedMetricType(Iterable<? extends CalculatedMetric.RestrictedMetricType> values) Output only.Output only.Output only.addRestrictedMetricTypeValue(int value) Output only.build()clear()Output only.Optional.Required.Required.Output only.Required.Identifier.Output only.Output only.com.google.protobuf.ByteStringOutput only.Optional.com.google.protobuf.ByteStringOptional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorRequired.com.google.protobuf.ByteStringRequired.Required.com.google.protobuf.ByteStringRequired.booleanOutput only.Required.intRequired.getName()Identifier.com.google.protobuf.ByteStringIdentifier.getRestrictedMetricType(int index) Output only.intOutput only.Output only.intgetRestrictedMetricTypeValue(int index) Output only.Output only.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(CalculatedMetric other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) setCalculatedMetricId(String value) Output only.setCalculatedMetricIdBytes(com.google.protobuf.ByteString value) Output only.setDescription(String value) Optional.setDescriptionBytes(com.google.protobuf.ByteString value) Optional.setDisplayName(String value) Required.setDisplayNameBytes(com.google.protobuf.ByteString value) Required.setFormula(String value) Required.setFormulaBytes(com.google.protobuf.ByteString value) Required.setInvalidMetricReference(boolean value) Output only.Required.setMetricUnitValue(int value) Required.Identifier.setNameBytes(com.google.protobuf.ByteString value) Identifier.setRestrictedMetricType(int index, CalculatedMetric.RestrictedMetricType value) Output only.setRestrictedMetricTypeValue(int index, int value) Output only.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<CalculatedMetric.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<CalculatedMetric.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<CalculatedMetric.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<CalculatedMetric.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<CalculatedMetric.Builder>
-
mergeFrom
public CalculatedMetric.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CalculatedMetric.Builder>- Throws:
IOException
-
getName
Identifier. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Specified by:
getNamein interfaceCalculatedMetricOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()Identifier. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Specified by:
getNameBytesin interfaceCalculatedMetricOrBuilder- Returns:
- The bytes for name.
-
setName
Identifier. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
Identifier. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Returns:
- This builder for chaining.
-
setNameBytes
Identifier. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'string name = 1 [(.google.api.field_behavior) = IDENTIFIER];- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
getDescription
Optional. Description for this calculated metric. Max length of 4096 characters.
string description = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDescriptionin interfaceCalculatedMetricOrBuilder- Returns:
- The description.
-
getDescriptionBytes
public com.google.protobuf.ByteString getDescriptionBytes()Optional. Description for this calculated metric. Max length of 4096 characters.
string description = 2 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getDescriptionBytesin interfaceCalculatedMetricOrBuilder- Returns:
- The bytes for description.
-
setDescription
Optional. Description for this calculated metric. Max length of 4096 characters.
string description = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The description to set.- Returns:
- This builder for chaining.
-
clearDescription
Optional. Description for this calculated metric. Max length of 4096 characters.
string description = 2 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
setDescriptionBytes
Optional. Description for this calculated metric. Max length of 4096 characters.
string description = 2 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The bytes for description to set.- Returns:
- This builder for chaining.
-
getDisplayName
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string display_name = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDisplayNamein interfaceCalculatedMetricOrBuilder- Returns:
- The displayName.
-
getDisplayNameBytes
public com.google.protobuf.ByteString getDisplayNameBytes()Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string display_name = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getDisplayNameBytesin interfaceCalculatedMetricOrBuilder- Returns:
- The bytes for displayName.
-
setDisplayName
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string display_name = 3 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The displayName to set.- Returns:
- This builder for chaining.
-
clearDisplayName
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string display_name = 3 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
setDisplayNameBytes
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
string display_name = 3 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The bytes for displayName to set.- Returns:
- This builder for chaining.
-
getCalculatedMetricId
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCalculatedMetricIdin interfaceCalculatedMetricOrBuilder- Returns:
- The calculatedMetricId.
-
getCalculatedMetricIdBytes
public com.google.protobuf.ByteString getCalculatedMetricIdBytes()Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getCalculatedMetricIdBytesin interfaceCalculatedMetricOrBuilder- Returns:
- The bytes for calculatedMetricId.
-
setCalculatedMetricId
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
value- The calculatedMetricId to set.- Returns:
- This builder for chaining.
-
clearCalculatedMetricId
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];- Returns:
- This builder for chaining.
-
setCalculatedMetricIdBytes
Output only. The ID to use for the calculated metric. In the UI, this is referred to as the "API name." The calculated_metric_id is used when referencing this calculated metric from external APIs. For example, "calcMetric:{calculated_metric_id}".string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
value- The bytes for calculatedMetricId to set.- Returns:
- This builder for chaining.
-
getMetricUnitValue
public int getMetricUnitValue()Required. The type for the calculated metric's value.
.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getMetricUnitValuein interfaceCalculatedMetricOrBuilder- Returns:
- The enum numeric value on the wire for metricUnit.
-
setMetricUnitValue
Required. The type for the calculated metric's value.
.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The enum numeric value on the wire for metricUnit to set.- Returns:
- This builder for chaining.
-
getMetricUnit
Required. The type for the calculated metric's value.
.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getMetricUnitin interfaceCalculatedMetricOrBuilder- Returns:
- The metricUnit.
-
setMetricUnit
Required. The type for the calculated metric's value.
.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The metricUnit to set.- Returns:
- This builder for chaining.
-
clearMetricUnit
Required. The type for the calculated metric's value.
.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
getRestrictedMetricTypeList
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getRestrictedMetricTypeListin interfaceCalculatedMetricOrBuilder- Returns:
- A list containing the restrictedMetricType.
-
getRestrictedMetricTypeCount
public int getRestrictedMetricTypeCount()Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getRestrictedMetricTypeCountin interfaceCalculatedMetricOrBuilder- Returns:
- The count of restrictedMetricType.
-
getRestrictedMetricType
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getRestrictedMetricTypein interfaceCalculatedMetricOrBuilder- Parameters:
index- The index of the element to return.- Returns:
- The restrictedMetricType at the given index.
-
setRestrictedMetricType
public CalculatedMetric.Builder setRestrictedMetricType(int index, CalculatedMetric.RestrictedMetricType value) Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
index- The index to set the value at.value- The restrictedMetricType to set.- Returns:
- This builder for chaining.
-
addRestrictedMetricType
public CalculatedMetric.Builder addRestrictedMetricType(CalculatedMetric.RestrictedMetricType value) Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
value- The restrictedMetricType to add.- Returns:
- This builder for chaining.
-
addAllRestrictedMetricType
public CalculatedMetric.Builder addAllRestrictedMetricType(Iterable<? extends CalculatedMetric.RestrictedMetricType> values) Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
values- The restrictedMetricType to add.- Returns:
- This builder for chaining.
-
clearRestrictedMetricType
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Returns:
- This builder for chaining.
-
getRestrictedMetricTypeValueList
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getRestrictedMetricTypeValueListin interfaceCalculatedMetricOrBuilder- Returns:
- A list containing the enum numeric values on the wire for restrictedMetricType.
-
getRestrictedMetricTypeValue
public int getRestrictedMetricTypeValue(int index) Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getRestrictedMetricTypeValuein interfaceCalculatedMetricOrBuilder- Parameters:
index- The index of the value to return.- Returns:
- The enum numeric value on the wire of restrictedMetricType at the given index.
-
setRestrictedMetricTypeValue
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
index- The index to set the value at.value- The enum numeric value on the wire for restrictedMetricType to set.- Returns:
- This builder for chaining.
-
addRestrictedMetricTypeValue
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
value- The enum numeric value on the wire for restrictedMetricType to add.- Returns:
- This builder for chaining.
-
addAllRestrictedMetricTypeValue
Output only. Types of restricted data that this metric contains.
repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
values- The enum numeric values on the wire for restrictedMetricType to add.- Returns:
- This builder for chaining.
-
getFormula
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string formula = 7 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getFormulain interfaceCalculatedMetricOrBuilder- Returns:
- The formula.
-
getFormulaBytes
public com.google.protobuf.ByteString getFormulaBytes()Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string formula = 7 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getFormulaBytesin interfaceCalculatedMetricOrBuilder- Returns:
- The bytes for formula.
-
setFormula
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string formula = 7 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The formula to set.- Returns:
- This builder for chaining.
-
clearFormula
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string formula = 7 [(.google.api.field_behavior) = REQUIRED];- Returns:
- This builder for chaining.
-
setFormulaBytes
Required. The calculated metric's definition. Maximum number of unique referenced custom metrics is 5. Formulas supports the following operations: + (addition), - (subtraction), - (negative), * (multiplication), / (division), () (parenthesis). Any valid real numbers are acceptable that fit in a Long (64bit integer) or a Double (64 bit floating point number). Example formula: "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
string formula = 7 [(.google.api.field_behavior) = REQUIRED];- Parameters:
value- The bytes for formula to set.- Returns:
- This builder for chaining.
-
getInvalidMetricReference
public boolean getInvalidMetricReference()Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Specified by:
getInvalidMetricReferencein interfaceCalculatedMetricOrBuilder- Returns:
- The invalidMetricReference.
-
setInvalidMetricReference
Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Parameters:
value- The invalidMetricReference to set.- Returns:
- This builder for chaining.
-
clearInvalidMetricReference
Output only. If true, this calculated metric has a invalid metric reference. Anything using a calculated metric with invalid_metric_reference set to true may fail, produce warnings, or produce unexpected results.
bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];- Returns:
- This builder for chaining.
-