Class OSPolicyAssignment.LabelSet.Builder (2.11.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.v1alpha.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
Fie