Class CustomRule
java.lang.Object
com.azure.resourcemanager.cdn.models.CustomRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CustomRule>
- Direct Known Subclasses:
RateLimitRule
Defines the common attributes for a custom rule that can be included in a waf policy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Get the action property: Describes what action to be applied when rule matches.Get the enabledState property: Describes if the custom rule is in enabled or disabled state.static CustomRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CustomRule from the JsonReader.Get the matchConditions property: List of match conditions.name()Get the name property: Defines the name of the custom rule.intpriority()Get the priority property: Defines in what order this rule be evaluated in the overall list of custom rules.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAction(ActionType action) Set the action property: Describes what action to be applied when rule matches.withEnabledState(CustomRuleEnabledState enabledState) Set the enabledState property: Describes if the custom rule is in enabled or disabled state.withMatchConditions(List<MatchCondition> matchConditions) Set the matchConditions property: List of match conditions.Set the name property: Defines the name of the custom rule.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 class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CustomRule
public CustomRule()Creates an instance of CustomRule class.
-
-
Method Details
-
name
Get the name property: Defines the name of the custom rule.- Returns:
- the name value.
-
withName
Set the name property: Defines the name of the custom rule.- Parameters:
name- the name value to set.- Returns:
- the CustomRule object itself.
-
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.
-
withEnabledState
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.
-
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.
-
withPriority
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.
-
matchConditions
Get the matchConditions property: List of match conditions.- Returns:
- the matchConditions value.
-
withMatchConditions
Set the matchConditions property: List of match conditions.- Parameters:
matchConditions- the matchConditions value to set.- Returns:
- the CustomRule object itself.
-
action
Get the action property: Describes what action to be applied when rule matches.- Returns:
- the action value.
-
withAction
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.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CustomRule>- Throws:
IOException
-
fromJson
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:
IllegalStateException- If the deserialized JSON object was missing any required properties.IOException- If an error occurs while reading the CustomRule.
-