Class OSPolicyAssignment.LabelSet.Builder (2.9.0)

public static final class OSPolicyAssignment.LabelSet.Builder extends GeneratedMessageV3.Builder<OSPolicyAssignment.LabelSet.Builder> implements OSPolicyAssignment.LabelSetOrBuilder

Message representing label set.

  • A label is a key value pair set for a VM.
  • A LabelSet is a set of labels.
  • Labels within a LabelSet are ANDed. In other words, a LabelSet is applicable for a VM only if it matches all the labels in the LabelSet.
  • Example: A LabelSet with 2 labels: env=prod and type=webserver will only be applicable for those VMs with both labels present.

Protobuf type google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public OSPolicyAssignment.LabelSet build()
Returns
TypeDescription
OSPolicyAssignment.LabelSet

buildPartial()

public OSPolicyAssignment.LabelSet buildPartial()
Returns
TypeDescription
OSPolicyAssignment.LabelSet

clear()

public OSPolicyAssignment.LabelSet.Builder clear()
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

clearLabels()

public OSPolicyAssignment.LabelSet.Builder clearLabels()
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

public OSPolicyAssignment.LabelSet.Builder clone()
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder
Overrides

containsLabels(String key)

public boolean containsLabels(String key)

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getDefaultInstanceForType()

public OSPolicyAssignment.LabelSet getDefaultInstanceForType()
Returns
TypeDescription
OSPolicyAssignment.LabelSet

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

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Returns
TypeDescription
int

getLabelsMap()

public Map<String,String> getLabelsMap()

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

public String getLabelsOrDefault(String key, String defaultValue)

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

public String getLabelsOrThrow(String key)

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMutableLabels()

public Map<String,String> getMutableLabels()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

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(OSPolicyAssignment.LabelSet other)

public OSPolicyAssignment.LabelSet.Builder mergeFrom(OSPolicyAssignment.LabelSet other)
Parameter
NameDescription
otherOSPolicyAssignment.LabelSet
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

putAllLabels(Map<String,String> values)

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

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder

putLabels(String key, String value)

public OSPolicyAssignment.LabelSet.Builder putLabels(String key, String value)

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder

removeLabels(String key)

public OSPolicyAssignment.LabelSet.Builder removeLabels(String key)

Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected.

map<string, string> labels = 1;

Parameter
NameDescription
keyString
Returns
TypeDescription
OSPolicyAssignment.LabelSet.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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