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

public final class PortRange extends Object implements com.azure.json.JsonSerializable<PortRange>
The port range.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    static PortRange
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of PortRange from the JsonReader.
    Get the portEnd property: The maximum port that is included in the range.
    Get the portStart property: The minimum port that is included in the range.
    Get the protocol property: The network protocol of the port.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the portEnd property: The maximum port that is included in the range.
    Set the portStart property: The minimum port that is included in the range.
    Set the protocol property: The network protocol of the port.

    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

    • PortRange

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

    • portStart

      public Integer portStart()
      Get the portStart property: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd.
      Returns:
      the portStart value.
    • withPortStart

      public PortRange withPortStart(Integer portStart)
      Set the portStart property: The minimum port that is included in the range. It should be ranged from 1 to 65535, and be less than or equal to portEnd.
      Parameters:
      portStart - the portStart value to set.
      Returns:
      the PortRange object itself.
    • portEnd

      public Integer portEnd()
      Get the portEnd property: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart.
      Returns:
      the portEnd value.
    • withPortEnd

      public PortRange withPortEnd(Integer portEnd)
      Set the portEnd property: The maximum port that is included in the range. It should be ranged from 1 to 65535, and be greater than or equal to portStart.
      Parameters:
      portEnd - the portEnd value to set.
      Returns:
      the PortRange object itself.
    • protocol

      public Protocol protocol()
      Get the protocol property: The network protocol of the port.
      Returns:
      the protocol value.
    • withProtocol

      public PortRange withProtocol(Protocol protocol)
      Set the protocol property: The network protocol of the port.
      Parameters:
      protocol - the protocol value to set.
      Returns:
      the PortRange 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<PortRange>
      Throws:
      IOException
    • fromJson

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