Class KeyValuePair.Builder (0.58.0)

public static final class KeyValuePair.Builder extends GeneratedMessage.Builder<KeyValuePair.Builder> implements KeyValuePairOrBuilder

KeyValuePair defines a key-value pair for matching resource labels.

Protobuf type google.cloud.backupdr.v1beta.KeyValuePair

Static Methods

getDescriptor()

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

Methods

addAllValues(Iterable<String> values)

public KeyValuePair.Builder addAllValues(Iterable<String> values)

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
values Iterable<String>

The values to add.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

addValues(String value)

public KeyValuePair.Builder addValues(String value)

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The values to add.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

addValuesBytes(ByteString value)

public KeyValuePair.Builder addValuesBytes(ByteString value)

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes of the values to add.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

build()

public KeyValuePair build()
Returns
Type Description
KeyValuePair

buildPartial()

public KeyValuePair buildPartial()
Returns
Type Description
KeyValuePair

clear()

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

clearKey()

public KeyValuePair.Builder clearKey()

Required. The key of the label to match. This must be in the format {label_key}. The key must match the regex Format:\p{Ll}\p{Lo}{0,62}.

string key = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

clearValues()

public KeyValuePair.Builder clearValues()

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

getDefaultInstanceForType()

public KeyValuePair getDefaultInstanceForType()
Returns
Type Description
KeyValuePair

getDescriptorForType()

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

getKey()

public String getKey()

Required. The key of the label to match. This must be in the format {label_key}. The key must match the regex Format:\p{Ll}\p{Lo}{0,62}.

string key = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The key.

getKeyBytes()

public ByteString getKeyBytes()

Required. The key of the label to match. This must be in the format {label_key}. The key must match the regex Format:\p{Ll}\p{Lo}{0,62}.

string key = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for key.

getValues(int index)

public String getValues(int index)

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

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)

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

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

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The count of values.

getValuesList()

public ProtocolStringList getValuesList()

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ProtocolStringList

A list containing the values.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(KeyValuePair other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

setKey(String value)

public KeyValuePair.Builder setKey(String value)

Required. The key of the label to match. This must be in the format {label_key}. The key must match the regex Format:\p{Ll}\p{Lo}{0,62}.

string key = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value String

The key to set.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

setKeyBytes(ByteString value)

public KeyValuePair.Builder setKeyBytes(ByteString value)

Required. The key of the label to match. This must be in the format {label_key}. The key must match the regex Format:\p{Ll}\p{Lo}{0,62}.

string key = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value ByteString

The bytes for key to set.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.

setValues(int index, String value)

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

Required. The values of the label to match. There will be explicit “OR” between values of array. Each value must be in the format {label_value}. The value must match the regex Format: [\\p{Ll}\\p{Lo}\\p{N}_-]{1,63}.

repeated string values = 2 [(.google.api.field_behavior) = REQUIRED];

Parameters
Name Description
index int

The index to set the value at.

value String

The values to set.

Returns
Type Description
KeyValuePair.Builder

This builder for chaining.