Class ResourceSelector.Builder (0.43.0)

public static final class ResourceSelector.Builder extends GeneratedMessageV3.Builder<ResourceSelector.Builder> implements ResourceSelectorOrBuilder

Defines a selector to identify a single or a group of resources. Conditions in the selector are optional, but at least one field should be set to a non-empty value. If a condition is not specified, no restrictions will be applied on that dimension. If more than one condition is specified, a resource will be selected if and only if all conditions are met.

Protobuf type google.cloud.gkebackup.v1.ResourceSelector

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public ResourceSelector build()
Returns
Type Description
ResourceSelector

buildPartial()

public ResourceSelector buildPartial()
Returns
Type Description
ResourceSelector

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearGroupKind()

public ResourceSelector.Builder clearGroupKind()

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ResourceSelector.Builder

clearLabels()

public ResourceSelector.Builder clearLabels()
Returns
Type Description
ResourceSelector.Builder

clearName()

public ResourceSelector.Builder clearName()

Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.

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

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

clearNamespace()

public ResourceSelector.Builder clearNamespace()

Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The Namespace resource itself will be restored if and only if any resources within the namespace are restored.

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

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

containsLabels(String key)

public boolean containsLabels(String key)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
boolean

getDefaultInstanceForType()

public ResourceSelector getDefaultInstanceForType()
Returns
Type Description
ResourceSelector

getDescriptorForType()

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

getGroupKind()

public RestoreConfig.GroupKind getGroupKind()

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
RestoreConfig.GroupKind

The groupKind.

getGroupKindBuilder()

public RestoreConfig.GroupKind.Builder getGroupKindBuilder()

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
RestoreConfig.GroupKind.Builder

getGroupKindOrBuilder()

public RestoreConfig.GroupKindOrBuilder getGroupKindOrBuilder()

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
RestoreConfig.GroupKindOrBuilder

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
Type Description
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
String

getMutableLabels() (deprecated)

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getName()

public String getName()

Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.

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

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.

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

Returns
Type Description
ByteString

The bytes for name.

getNamespace()

public String getNamespace()

Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The Namespace resource itself will be restored if and only if any resources within the namespace are restored.

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

Returns
Type Description
String

The namespace.

getNamespaceBytes()

public ByteString getNamespaceBytes()

Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The Namespace resource itself will be restored if and only if any resources within the namespace are restored.

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

Returns
Type Description
ByteString

The bytes for namespace.

hasGroupKind()

public boolean hasGroupKind()

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
boolean

Whether the groupKind field is set.

internalGetFieldAccessorTable()

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

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(ResourceSelector other)

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

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeGroupKind(RestoreConfig.GroupKind value)

public ResourceSelector.Builder mergeGroupKind(RestoreConfig.GroupKind value)

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value RestoreConfig.GroupKind
Returns
Type Description
ResourceSelector.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

public ResourceSelector.Builder putAllLabels(Map<String,String> values)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
values Map<String,String>
Returns
Type Description
ResourceSelector.Builder

putLabels(String key, String value)

public ResourceSelector.Builder putLabels(String key, String value)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameters
Name Description
key String
value String
Returns
Type Description
ResourceSelector.Builder

removeLabels(String key)

public ResourceSelector.Builder removeLabels(String key)

Optional. Selects resources using Kubernetes labels. If specified, a resource will be selected if and only if the resource has all of the provided labels and all the label values match.

map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
key String
Returns
Type Description
ResourceSelector.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setGroupKind(RestoreConfig.GroupKind value)

public ResourceSelector.Builder setGroupKind(RestoreConfig.GroupKind value)

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
value RestoreConfig.GroupKind
Returns
Type Description
ResourceSelector.Builder

setGroupKind(RestoreConfig.GroupKind.Builder builderForValue)

public ResourceSelector.Builder setGroupKind(RestoreConfig.GroupKind.Builder builderForValue)

Optional. Selects resources using their Kubernetes GroupKinds. If specified, only resources of provided GroupKind will be selected.

.google.cloud.gkebackup.v1.RestoreConfig.GroupKind group_kind = 1 [(.google.api.field_behavior) = OPTIONAL];

Parameter
Name Description
builderForValue RestoreConfig.GroupKind.Builder
Returns
Type Description
ResourceSelector.Builder

setName(String value)

public ResourceSelector.Builder setName(String value)

Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.

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

Parameter
Name Description
value String

The name to set.

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

setNameBytes(ByteString value)

public ResourceSelector.Builder setNameBytes(ByteString value)

Optional. Selects resources using their resource names. If specified, only resources with the provided name will be selected.

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

Parameter
Name Description
value ByteString

The bytes for name to set.

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

setNamespace(String value)

public ResourceSelector.Builder setNamespace(String value)

Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The Namespace resource itself will be restored if and only if any resources within the namespace are restored.

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

Parameter
Name Description
value String

The namespace to set.

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

setNamespaceBytes(ByteString value)

public ResourceSelector.Builder setNamespaceBytes(ByteString value)

Optional. Selects resources using their namespaces. This only applies to namespace scoped resources and cannot be used for selecting cluster scoped resources. If specified, only resources in the provided namespace will be selected. If not specified, the filter will apply to both cluster scoped and namespace scoped resources (e.g. name or label). The Namespace resource itself will be restored if and only if any resources within the namespace are restored.

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

Parameter
Name Description
value ByteString

The bytes for namespace to set.

Returns
Type Description
ResourceSelector.Builder

This builder for chaining.

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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