Top Description Fields Constructors Methods
org.apache.hc.core5.net

public Class Ports

extends Object
Class Inheritance
Imports
org.apache.hc.core5.util.Args

Port helper methods.
Since
5.0

Field Summary

Modifier and TypeField and Description
public static final int
MAX_VALUE

The maximum port value per https://tools.ietf.org/html/rfc6335.

public static final int
MIN_VALUE

The minimum port value per https://tools.ietf.org/html/rfc6335.

public static final int
SCHEME_DEFAULT

The scheme default port.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the port
check
(final int
The port to check.
port
)

Checks a port number.

public static int

Returns:

the port
checkWithDefault
(final int
The port to check where -1 indicates the scheme default port.
port
)

Checks a port number where -1 indicates the scheme default port.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

MAX_VALUEback to summary
public static final int MAX_VALUE

The maximum port value per https://tools.ietf.org/html/rfc6335.

MIN_VALUEback to summary
public static final int MIN_VALUE

The minimum port value per https://tools.ietf.org/html/rfc6335.

SCHEME_DEFAULTback to summary
public static final int SCHEME_DEFAULT

The scheme default port.

Constructor Detail

Portsback to summary
public Ports()

Method Detail

checkback to summary
public static int check(final int port)

Checks a port number.

Parameters
port:int

The port to check.

Returns:int

the port

Exceptions
IllegalArgumentException:
If the port parameter is outside the specified range of valid port values, which is between 0 and 65535, inclusive.
checkWithDefaultback to summary
public static int checkWithDefault(final int port)

Checks a port number where -1 indicates the scheme default port.

Parameters
port:int

The port to check where -1 indicates the scheme default port.

Returns:int

the port

Exceptions
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.