KubeLabelSelector Class

  • java.lang.Object
    • com.azure.resourcemanager.network.models.KubeLabelSelector

Implements

public final class KubeLabelSelector
implements JsonSerializable<KubeLabelSelector>

Kubernetes Label Selector for matching labels in Kubernetes Selector Groups.

Constructor Summary

Constructor Description
KubeLabelSelector()

Creates an instance of KubeLabelSelector class.

Method Summary

Modifier and Type Method and Description
static KubeLabelSelector fromJson(JsonReader jsonReader)

Reads an instance of KubeLabelSelector from the JsonReader.

List<LabelSelectorExpression> matchExpressions()

Get the matchExpressions property: matchExpressions is a list of label selector requirements.

Map<String,String> matchLabels()

Get the matchLabels property: matchLabels is a map of {key,value} pairs.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

KubeLabelSelector withMatchExpressions(List<LabelSelectorExpression> matchExpressions)

Set the matchExpressions property: matchExpressions is a list of label selector requirements.

KubeLabelSelector withMatchLabels(Map<String,String> matchLabels)

Set the matchLabels property: matchLabels is a map of {key,value} pairs.

Methods inherited from java.lang.Object

Constructor Details

KubeLabelSelector

public KubeLabelSelector()

Creates an instance of KubeLabelSelector class.

Method Details

fromJson

public static KubeLabelSelector fromJson(JsonReader jsonReader)

Reads an instance of KubeLabelSelector from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of KubeLabelSelector if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If an error occurs while reading the KubeLabelSelector.

matchExpressions

public List<LabelSelectorExpression> matchExpressions()

Get the matchExpressions property: matchExpressions is a list of label selector requirements. The requirements are ANDed.

Returns:

the matchExpressions value.

matchLabels

public Map<String,String> matchLabels()

Get the matchLabels property: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

Returns:

the matchLabels value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withMatchExpressions

public KubeLabelSelector withMatchExpressions(List<LabelSelectorExpression> matchExpressions)

Set the matchExpressions property: matchExpressions is a list of label selector requirements. The requirements are ANDed.

Parameters:

matchExpressions - the matchExpressions value to set.

Returns:

the KubeLabelSelector object itself.

withMatchLabels

public KubeLabelSelector withMatchLabels(Map<String,String> matchLabels)

Set the matchLabels property: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.

Parameters:

matchLabels - the matchLabels value to set.

Returns:

the KubeLabelSelector object itself.

Applies to