Class Namespace.Builder (2.20.0)

public static final class Namespace.Builder extends GeneratedMessageV3.Builder<Namespace.Builder> implements NamespaceOrBuilder

A container for services. Namespaces allow administrators to group services together and define permissions for a collection of services.

Protobuf type google.cloud.servicedirectory.v1.Namespace

Implements

NamespaceOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Namespace.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Namespace.Builder
Overrides

build()

public Namespace build()
Returns
TypeDescription
Namespace

buildPartial()

public Namespace buildPartial()
Returns
TypeDescription
Namespace

clear()

public Namespace.Builder clear()
Returns
TypeDescription
Namespace.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Namespace.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Namespace.Builder
Overrides

clearLabels()

public Namespace.Builder clearLabels()
Returns
TypeDescription
Namespace.Builder

clearName()

public Namespace.Builder clearName()

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Namespace.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Namespace.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Namespace.Builder
Overrides

clone()

public Namespace.Builder clone()
Returns
TypeDescription
Namespace.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public Namespace getDefaultInstanceForType()
Returns
TypeDescription
Namespace

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLabels()

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getName()

public String getName()

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for name.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Namespace other)

public Namespace.Builder mergeFrom(Namespace other)
Parameter
NameDescription
otherNamespace
Returns
TypeDescription
Namespace.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Namespace.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Namespace.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Namespace.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Namespace.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Namespace.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Namespace.Builder
Overrides

putAllLabels(Map<String,String> values)

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

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
Namespace.Builder

putLabels(String key, String value)

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

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
Namespace.Builder

removeLabels(String key)

public Namespace.Builder removeLabels(String key)

Optional. Resource labels associated with this Namespace. No more than 64 user labels can be associated with a given resource. Label keys and values can be no longer than 63 characters.

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

Parameter
NameDescription
keyString
Returns
TypeDescription
Namespace.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Namespace.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Namespace.Builder
Overrides

setName(String value)

public Namespace.Builder setName(String value)

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Namespace.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Namespace.Builder setNameBytes(ByteString value)

Immutable. The resource name for the namespace in the format projects/*/locations/*/namespaces/*.

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Namespace.Builder

This builder for chaining.

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

public Namespace.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Namespace.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Namespace.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Namespace.Builder
Overrides