Condition Class

  • java.lang.Object
    • com.azure.resourcemanager.alertsmanagement.models.Condition

Implements

public final class Condition
implements JsonSerializable<Condition>

Condition to trigger an alert processing rule.

Constructor Summary

Constructor Description
Condition()

Creates an instance of Condition class.

Method Summary

Modifier and Type Method and Description
Field field()

Get the field property: Field for a given condition.

static Condition fromJson(JsonReader jsonReader)

Reads an instance of Condition from the JsonReader.

Operator operator()

Get the operator property: Operator for a given condition.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

List<String> values()

Get the values property: List of values to match for a given condition.

Condition withField(Field field)

Set the field property: Field for a given condition.

Condition withOperator(Operator operator)

Set the operator property: Operator for a given condition.

Condition withValues(List<String> values)

Set the values property: List of values to match for a given condition.

Methods inherited from java.lang.Object

Constructor Details

Condition

public Condition()

Creates an instance of Condition class.

Method Details

field

public Field field()

Get the field property: Field for a given condition.

Returns:

the field value.

fromJson

public static Condition fromJson(JsonReader jsonReader)

Reads an instance of Condition from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

operator

public Operator operator()

Get the operator property: Operator for a given condition.

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: List of values to match for a given condition.

Returns:

the values value.

withField

public Condition withField(Field field)

Set the field property: Field for a given condition.

Parameters:

field - the field value to set.

Returns:

the Condition object itself.

withOperator

public Condition withOperator(Operator operator)

Set the operator property: Operator for a given condition.

Parameters:

operator - the operator value to set.

Returns:

the Condition object itself.

withValues

public Condition withValues(List<String> values)

Set the values property: List of values to match for a given condition.

Parameters:

values - the values value to set.

Returns:

the Condition object itself.

Applies to