Class AllocationAffinity.Builder (0.10.0)

public static final class AllocationAffinity.Builder extends GeneratedMessageV3.Builder<AllocationAffinity.Builder> implements AllocationAffinityOrBuilder

Specifies the reservations that this instance can consume from.

Protobuf type google.cloud.backupdr.v1.AllocationAffinity

Static Methods

getDescriptor()

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

Methods

addAllValues(Iterable<String> values)

public AllocationAffinity.Builder addAllValues(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)

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

addValues(String value)

public AllocationAffinity.Builder addValues(String value)

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)

public AllocationAffinity.Builder addValuesBytes(ByteString value)

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()

public AllocationAffinity build()
Returns
Type Description
AllocationAffinity

buildPartial()

public AllocationAffinity buildPartial()
Returns
Type Description
AllocationAffinity

clear()

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

clearConsumeAllocationType()

public AllocationAffinity.Builder clearConsumeAllocationType()

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)

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

clearKey()

public AllocationAffinity.Builder clearKey()

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)

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

clearValues()

public AllocationAffinity.Builder clearValues()

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()

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

getConsumeAllocationType()

public AllocationAffinity.Type getConsumeAllocationType()

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()

public int getConsumeAllocationTypeValue()

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()

public AllocationAffinity getDefaultInstanceForType()
Returns
Type Description
AllocationAffinity

getDescriptorForType()

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

getKey()

public String getKey()

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()

public ByteString getKeyBytes()

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)

public String getValues(int index)

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)

public ByteString getValuesBytes(int index)

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()

public int getValuesCount()

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()

public ProtocolStringList getValuesList()

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()

public boolean hasConsumeAllocationType()

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()

public boolean hasKey()

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()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(AllocationAffinity other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setConsumeAllocationType(AllocationAffinity.Type value)

public AllocationAffinity.Builder setConsumeAllocationType(AllocationAffinity.Type value)

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)

public AllocationAffinity.Builder setConsumeAllocationTypeValue(int value)

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)

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

setKey(String value)

public AllocationAffinity.Builder setKey(String value)

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)

public AllocationAffinity.Builder setKeyBytes(ByteString value)

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)

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

setUnknownFields(UnknownFieldSet unknownFields)

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

setValues(int index, String value)

public AllocationAffinity.Builder setValues(int index, String value)

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.