LabelSelectorExpression Class

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

Implements

public final class LabelSelectorExpression
implements JsonSerializable<LabelSelectorExpression>

A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.

Constructor Summary

Constructor Description
LabelSelectorExpression()

Creates an instance of LabelSelectorExpression class.

Method Summary

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

Reads an instance of LabelSelectorExpression from the JsonReader.

String key()

Get the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'.

LabelSelectorOperator operator()

Get the operator property: operator represents a key's relationship to a set of values.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

List<String> values()

Get the values property: values is an array of string values.

LabelSelectorExpression withKey(String key)

Set the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'.

LabelSelectorExpression withOperator(LabelSelectorOperator operator)

Set the operator property: operator represents a key's relationship to a set of values.

LabelSelectorExpression withValues(List<String> values)

Set the values property: values is an array of string values.

Methods inherited from java.lang.Object

Constructor Details

LabelSelectorExpression

public LabelSelectorExpression()

Creates an instance of LabelSelectorExpression class.

Method Details

fromJson

public static LabelSelectorExpression fromJson(JsonReader jsonReader)

Reads an instance of LabelSelectorExpression from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of LabelSelectorExpression 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 LabelSelectorExpression.

key

public String key()

Get the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'.

Returns:

the key value.

operator

public LabelSelectorOperator operator()

Get the operator property: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

Returns:

the operator value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

values

public List<String> values()

Get the values property: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.

Returns:

the values value.

withKey

public LabelSelectorExpression withKey(String key)

Set the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'.

Parameters:

key - the key value to set.

Returns:

the LabelSelectorExpression object itself.

withOperator

public LabelSelectorExpression withOperator(LabelSelectorOperator operator)

Set the operator property: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.

Parameters:

operator - the operator value to set.

Returns:

the LabelSelectorExpression object itself.

withValues

public LabelSelectorExpression withValues(List<String> values)

Set the values property: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty.

Parameters:

values - the values value to set.

Returns:

the LabelSelectorExpression object itself.

Applies to