LabelSelectorExpression Class
- java.
lang. Object - com.
azure. resourcemanager. network. models. LabelSelectorExpression
- com.
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 Label |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Label |
fromJson(JsonReader jsonReader)
Reads an instance of Label |
| String |
key()
Get the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'. |
|
Label |
operator()
Get the operator property: operator represents a key's relationship to a set of values. |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
| List<String> |
values()
Get the values property: values is an array of string values. |
|
Label |
withKey(String key)
Set the key property: key is a string of 63 characters or less, and must consist of alphanumeric characters, '-', '_' or '.'. |
|
Label |
withOperator(LabelSelectorOperator operator)
Set the operator property: operator represents a key's relationship to a set of values. |
|
Label |
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:
Returns:
Throws:
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:
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:
toJson
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:
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:
Returns:
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:
Returns:
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:
Returns: