public final class NetworkPortRange extends Object implements Serializable
dnsName
and ipAddress
datatypes. The range may have upper and lower bounds, be specified by a single port number, or
may be unbound.Modifier and Type | Field and Description |
---|---|
static NetworkPortRange |
MAX
|
static int |
MAX_NET_PORT_NUMBER
Maximum network socket port number (decimal).
|
static int |
MIN_NET_PORT_NUMBER
Minimum network socket port number (decimal).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class.
|
static NetworkPortRange |
getInstance(String value)
Creates an instance of
PortRange based on the given value. |
int |
getLowerBound()
Returns the lower-bound port value.
|
int |
getUpperBound()
Returns the upper-bound port value.
|
int |
hashCode() |
String |
toString() |
public static final int MIN_NET_PORT_NUMBER
public static final int MAX_NET_PORT_NUMBER
public static final NetworkPortRange MAX
public static NetworkPortRange getInstance(String value) throws IllegalArgumentException
PortRange
based on the given value.value
- a String
representing the range, that may be null or empty for unlimited range, or a valid port range as defined by appendix A.2 for IP address and DNS name.PortRange
IllegalArgumentException
- if the port range syntax is not: portnumber | "-"portnumber | portnumber"-"[portnumber]; or one of the portnumber values is not a valid decimal number in the
interval [0, 65535]public int getLowerBound()
UNBOUND
. If the range is actually a single port number, then this returns the same value as
getUpperBound
.public int getUpperBound()
UNBOUND
. If the range is actually a single port number, then this returns the same value as
getLowerBound
.public boolean equals(Object o)
Copyright © 2012–2020. All rights reserved.