Class RoutingPolicy

java.lang.Object
com.azure.resourcemanager.network.models.RoutingPolicy
All Implemented Interfaces:
com.azure.json.JsonSerializable<RoutingPolicy>

public final class RoutingPolicy extends Object implements com.azure.json.JsonSerializable<RoutingPolicy>
The routing policy object used in a RoutingIntent resource.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of RoutingPolicy class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the destinations property: List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic).
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of RoutingPolicy from the JsonReader.
    Get the name property: The unique name for the routing policy.
    Get the nextHop property: The next hop resource id on which this routing policy is applicable to.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withDestinations(List<String> destinations)
    Set the destinations property: List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic).
    Set the name property: The unique name for the routing policy.
    Set the nextHop property: The next hop resource id on which this routing policy is applicable to.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • RoutingPolicy

      public RoutingPolicy()
      Creates an instance of RoutingPolicy class.
  • Method Details

    • name

      public String name()
      Get the name property: The unique name for the routing policy.
      Returns:
      the name value.
    • withName

      public RoutingPolicy withName(String name)
      Set the name property: The unique name for the routing policy.
      Parameters:
      name - the name value to set.
      Returns:
      the RoutingPolicy object itself.
    • destinations

      public List<String> destinations()
      Get the destinations property: List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic).
      Returns:
      the destinations value.
    • withDestinations

      public RoutingPolicy withDestinations(List<String> destinations)
      Set the destinations property: List of all destinations which this routing policy is applicable to (for example: Internet, PrivateTraffic).
      Parameters:
      destinations - the destinations value to set.
      Returns:
      the RoutingPolicy object itself.
    • nextHop

      public String nextHop()
      Get the nextHop property: The next hop resource id on which this routing policy is applicable to.
      Returns:
      the nextHop value.
    • withNextHop

      public RoutingPolicy withNextHop(String nextHop)
      Set the nextHop property: The next hop resource id on which this routing policy is applicable to.
      Parameters:
      nextHop - the nextHop value to set.
      Returns:
      the RoutingPolicy object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<RoutingPolicy>
      Throws:
      IOException
    • fromJson

      public static RoutingPolicy fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of RoutingPolicy from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of RoutingPolicy 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 RoutingPolicy.