Class Ports


  • public class Ports
    extends java.lang.Object
    Port helper methods.
    Since:
    5.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int MAX_VALUE
      The maximum port value per https://tools.ietf.org/html/rfc6335.
      static int MIN_VALUE
      The minimum port value per https://tools.ietf.org/html/rfc6335.
      static int SCHEME_DEFAULT
      The scheme default port.
    • Constructor Summary

      Constructors 
      Constructor Description
      Ports()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int check​(int port)
      Checks a port number.
      static int checkWithDefault​(int port)
      Checks a port number where -1 indicates the scheme default port.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SCHEME_DEFAULT

        public static final int SCHEME_DEFAULT
        The scheme default port.
        See Also:
        Constant Field Values
      • MIN_VALUE

        public static final int MIN_VALUE
        The minimum port value per https://tools.ietf.org/html/rfc6335.
        See Also:
        Constant Field Values
      • MAX_VALUE

        public static final int MAX_VALUE
        The maximum port value per https://tools.ietf.org/html/rfc6335.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Ports

        public Ports()
    • Method Detail

      • checkWithDefault

        public static int checkWithDefault​(int port)
        Checks a port number where -1 indicates the scheme default port.
        Parameters:
        port - The port to check where -1 indicates the scheme default port.
        Returns:
        the port
        Throws:
        java.lang.IllegalArgumentException - If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive. -1 indicates the scheme default port.
      • check

        public static int check​(int port)
        Checks a port number.
        Parameters:
        port - The port to check.
        Returns:
        the port
        Throws:
        java.lang.IllegalArgumentException - If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.