Class IpAddressOrRange

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

public final class IpAddressOrRange extends Object implements com.azure.json.JsonSerializable<IpAddressOrRange>
IpAddressOrRange object.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of IpAddressOrRange from the JsonReader.
    Get the ipAddressOrRange property: A single IPv4 address or a single IPv4 address range in CIDR format.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withIpAddressOrRange(String ipAddressOrRange)
    Set the ipAddressOrRange property: A single IPv4 address or a single IPv4 address range in CIDR format.

    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

    • IpAddressOrRange

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

    • ipAddressOrRange

      public String ipAddressOrRange()
      Get the ipAddressOrRange property: A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”.
      Returns:
      the ipAddressOrRange value.
    • withIpAddressOrRange

      public IpAddressOrRange withIpAddressOrRange(String ipAddressOrRange)
      Set the ipAddressOrRange property: A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”.
      Parameters:
      ipAddressOrRange - the ipAddressOrRange value to set.
      Returns:
      the IpAddressOrRange 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<IpAddressOrRange>
      Throws:
      IOException
    • fromJson

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