Package org.apache.hc.core5.net
Class Ports
java.lang.Object
org.apache.hc.core5.net.Ports
Port helper methods.
- Since:
- 5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The maximum port value per https://tools.ietf.org/html/rfc6335.static final int
The minimum port value per https://tools.ietf.org/html/rfc6335.static final int
The scheme default port. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
check
(int port) Checks a port number.static int
checkWithDefault
(int port) Checks a port number where-1
indicates the scheme default port.
-
Field Details
-
SCHEME_DEFAULT
public static final int SCHEME_DEFAULTThe scheme default port.- See Also:
-
MIN_VALUE
public static final int MIN_VALUEThe minimum port value per https://tools.ietf.org/html/rfc6335.- See Also:
-
MAX_VALUE
public static final int MAX_VALUEThe maximum port value per https://tools.ietf.org/html/rfc6335.- See Also:
-
-
Constructor Details
-
Ports
public Ports()
-
-
Method Details
-
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:
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:
IllegalArgumentException
- If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
-