Class DeliveryRule
java.lang.Object
com.azure.resourcemanager.cdn.models.DeliveryRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<DeliveryRule>
public final class DeliveryRule
extends Object
implements com.azure.json.JsonSerializable<DeliveryRule>
A rule that specifies a set of actions and conditions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactions()Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied.Get the conditions property: A list of conditions that must be matched for the actions to be executed.static DeliveryRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of DeliveryRule from the JsonReader.name()Get the name property: Name of the rule.intorder()Get the order property: The order in which the rules are applied for the endpoint.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withActions(List<DeliveryRuleAction> actions) Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied.withConditions(List<DeliveryRuleCondition> conditions) Set the conditions property: A list of conditions that must be matched for the actions to be executed.Set the name property: Name of the rule.withOrder(int order) Set the order property: The order in which the rules are applied for the endpoint.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
-
DeliveryRule
public DeliveryRule()Creates an instance of DeliveryRule class.
-
-
Method Details
-
name
-
withName
Set the name property: Name of the rule.- Parameters:
name- the name value to set.- Returns:
- the DeliveryRule object itself.
-
order
public int order()Get the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.- Returns:
- the order value.
-
withOrder
Set the order property: The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied.- Parameters:
order- the order value to set.- Returns:
- the DeliveryRule object itself.
-
conditions
Get the conditions property: A list of conditions that must be matched for the actions to be executed.- Returns:
- the conditions value.
-
withConditions
Set the conditions property: A list of conditions that must be matched for the actions to be executed.- Parameters:
conditions- the conditions value to set.- Returns:
- the DeliveryRule object itself.
-
actions
Get the actions property: A list of actions that are executed when all the conditions of a rule are satisfied.- Returns:
- the actions value.
-
withActions
Set the actions property: A list of actions that are executed when all the conditions of a rule are satisfied.- Parameters:
actions- the actions value to set.- Returns:
- the DeliveryRule 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<DeliveryRule>- Throws:
IOException
-
fromJson
Reads an instance of DeliveryRule from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of DeliveryRule 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 DeliveryRule.
-