Class AllocationAffinity.Builder (0.10.0)

publicstaticfinalclass AllocationAffinity.BuilderextendsGeneratedMessageV3.Builder<AllocationAffinity.Builder>implementsAllocationAffinityOrBuilder

Specifies the reservations that this instance can consume from.

Protobuf type google.cloud.backupdr.v1.AllocationAffinity

Inherited Members

com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)

Static Methods

getDescriptor()

publicstaticfinalDescriptors.DescriptorgetDescriptor()
Returns
Type Description
Descriptor

Methods

addAllValues(Iterable<String> values)

publicAllocationAffinity.BuilderaddAllValues(Iterable<String>values)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Iterable<String>

The values to add.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

publicAllocationAffinity.BuilderaddRepeatedField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AllocationAffinity.Builder
Overrides

addValues(String value)

publicAllocationAffinity.BuilderaddValues(Stringvalue)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The values to add.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

addValuesBytes(ByteString value)

publicAllocationAffinity.BuilderaddValuesBytes(ByteStringvalue)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes of the values to add.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

build()

publicAllocationAffinitybuild()
Returns
Type Description
AllocationAffinity

buildPartial()

publicAllocationAffinitybuildPartial()
Returns
Type Description
AllocationAffinity

clear()

publicAllocationAffinity.Builderclear()
Returns
Type Description
AllocationAffinity.Builder
Overrides

clearConsumeAllocationType()

publicAllocationAffinity.BuilderclearConsumeAllocationType()

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

publicAllocationAffinity.BuilderclearField(Descriptors.FieldDescriptorfield)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
AllocationAffinity.Builder
Overrides

clearKey()

publicAllocationAffinity.BuilderclearKey()

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

publicAllocationAffinity.BuilderclearOneof(Descriptors.OneofDescriptoroneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
AllocationAffinity.Builder
Overrides

clearValues()

publicAllocationAffinity.BuilderclearValues()

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

clone()

publicAllocationAffinity.Builderclone()
Returns
Type Description
AllocationAffinity.Builder
Overrides

getConsumeAllocationType()

publicAllocationAffinity.TypegetConsumeAllocationType()

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AllocationAffinity.Type

The consumeAllocationType.

getConsumeAllocationTypeValue()

publicintgetConsumeAllocationTypeValue()

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The enum numeric value on the wire for consumeAllocationType.

getDefaultInstanceForType()

publicAllocationAffinitygetDefaultInstanceForType()
Returns
Type Description
AllocationAffinity

getDescriptorForType()

publicDescriptors.DescriptorgetDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getKey()

publicStringgetKey()

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The key.

getKeyBytes()

publicByteStringgetKeyBytes()

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for key.

getValues(int index)

publicStringgetValues(intindex)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The values at the given index.

getValuesBytes(int index)

publicByteStringgetValuesBytes(intindex)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the values at the given index.

getValuesCount()

publicintgetValuesCount()

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

The count of values.

getValuesList()

publicProtocolStringListgetValuesList()

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ProtocolStringList

A list containing the values.

hasConsumeAllocationType()

publicbooleanhasConsumeAllocationType()

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the consumeAllocationType field is set.

hasKey()

publicbooleanhasKey()

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the key field is set.

internalGetFieldAccessorTable()

protectedGeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

publicfinalbooleanisInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AllocationAffinity other)

publicAllocationAffinity.BuildermergeFrom(AllocationAffinityother)
Parameter
Name Description
other AllocationAffinity
Returns
Type Description
AllocationAffinity.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

publicAllocationAffinity.BuildermergeFrom(CodedInputStreaminput,ExtensionRegistryLiteextensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
AllocationAffinity.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

publicAllocationAffinity.BuildermergeFrom(Messageother)
Parameter
Name Description
other Message
Returns
Type Description
AllocationAffinity.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

publicfinalAllocationAffinity.BuildermergeUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AllocationAffinity.Builder
Overrides

setConsumeAllocationType(AllocationAffinity.Type value)

publicAllocationAffinity.BuildersetConsumeAllocationType(AllocationAffinity.Typevalue)

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value AllocationAffinity.Type

The consumeAllocationType to set.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

setConsumeAllocationTypeValue(int value)

publicAllocationAffinity.BuildersetConsumeAllocationTypeValue(intvalue)

Optional. Specifies the type of reservation from which this instance can consume

optional .google.cloud.backupdr.v1.AllocationAffinity.Type consume_allocation_type = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value int

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

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

publicAllocationAffinity.BuildersetField(Descriptors.FieldDescriptorfield,Objectvalue)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
AllocationAffinity.Builder
Overrides

setKey(String value)

publicAllocationAffinity.BuildersetKey(Stringvalue)

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value String

The key to set.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

setKeyBytes(ByteString value)

publicAllocationAffinity.BuildersetKeyBytes(ByteStringvalue)

Optional. Corresponds to the label key of a reservation resource.

optional string key = 2 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value ByteString

The bytes for key to set.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

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

publicAllocationAffinity.BuildersetRepeatedField(Descriptors.FieldDescriptorfield,intindex,Objectvalue)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
AllocationAffinity.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

publicfinalAllocationAffinity.BuildersetUnknownFields(UnknownFieldSetunknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
AllocationAffinity.Builder
Overrides

setValues(int index, String value)

publicAllocationAffinity.BuildersetValues(intindex,Stringvalue)

Optional. Corresponds to the label values of a reservation resource.

repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
index int

The index to set the value at.

value String

The values to set.

Returns
Type Description
AllocationAffinity.Builder

This builder for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月19日 UTC.