public class Ports extends Object
Modifier and Type | Field and 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 and Description |
---|
Ports() |
Modifier and Type | Method and 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. |
public static final int SCHEME_DEFAULT
public static final int MIN_VALUE
public static final int MAX_VALUE
public static int checkWithDefault(int port)
-1
indicates the scheme default port.port
- The port to check where -1
indicates the scheme default port.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.public static int check(int port)
port
- The port to check.IllegalArgumentException
- If the port parameter is outside the specified range of valid port values, which is between 0 and
65535, inclusive.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.