Partager via


CustomRule Class

  • java.lang.Object
    • com.azure.resourcemanager.cdn.models.CustomRule

Implements

public class CustomRule
implements JsonSerializable<CustomRule>

Defines the common attributes for a custom rule that can be included in a waf policy.

Constructor Summary

Constructor Description
CustomRule()

Creates an instance of CustomRule class.

Method Summary

Modifier and Type Method and Description
ActionType action()

Get the action property: Describes what action to be applied when rule matches.

CustomRuleEnabledState enabledState()

Get the enabledState property: Describes if the custom rule is in enabled or disabled state.

static CustomRule fromJson(JsonReader jsonReader)

Reads an instance of CustomRule from the JsonReader.

List<MatchCondition> matchConditions()

Get the matchConditions property: List of match conditions.

String name()

Get the name property: Defines the name of the custom rule.

int priority()

Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

CustomRule withAction(ActionType action)

Set the action property: Describes what action to be applied when rule matches.

CustomRule withEnabledState(CustomRuleEnabledState enabledState)

Set the enabledState property: Describes if the custom rule is in enabled or disabled state.

CustomRule withMatchConditions(List<MatchCondition> matchConditions)

Set the matchConditions property: List of match conditions.

CustomRule withName(String name)

Set the name property: Defines the name of the custom rule.

CustomRule withPriority(int priority)

Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.

Methods inherited from java.lang.Object

Constructor Details

CustomRule

public CustomRule()

Creates an instance of CustomRule class.

Method Details

action

public ActionType action()

Get the action property: Describes what action to be applied when rule matches.

Returns:

the action value.

enabledState

public CustomRuleEnabledState enabledState()

Get the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.

Returns:

the enabledState value.

fromJson

public static CustomRule fromJson(JsonReader jsonReader)

Reads an instance of CustomRule from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

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

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

matchConditions

public List matchConditions()

Get the matchConditions property: List of match conditions.

Returns:

the matchConditions value.

name

public String name()

Get the name property: Defines the name of the custom rule.

Returns:

the name value.

priority

public int priority()

Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.

Returns:

the priority value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

withAction

public CustomRule withAction(ActionType action)

Set the action property: Describes what action to be applied when rule matches.

Parameters:

action - the action value to set.

Returns:

the CustomRule object itself.

withEnabledState

public CustomRule withEnabledState(CustomRuleEnabledState enabledState)

Set the enabledState property: Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified.

Parameters:

enabledState - the enabledState value to set.

Returns:

the CustomRule object itself.

withMatchConditions

public CustomRule withMatchConditions(List matchConditions)

Set the matchConditions property: List of match conditions.

Parameters:

matchConditions - the matchConditions value to set.

Returns:

the CustomRule object itself.

withName

public CustomRule withName(String name)

Set the name property: Defines the name of the custom rule.

Parameters:

name - the name value to set.

Returns:

the CustomRule object itself.

withPriority

public CustomRule withPriority(int priority)

Set the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.

Parameters:

priority - the priority value to set.

Returns:

the CustomRule object itself.

Applies to