java.lang.Object
org.glassfish.grizzly.PortRange
Immutable class representing a port range.
- Author:
- Gerd Behrmann, Tigran Mkrtchyan
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
PortRange
public PortRange(int low, int high) Creates a port range with the given bounds (both inclusive).- Parameters:
low
- start of port rangehigh
- end of port range- Throws:
IllegalArgumentException
- is either bound is not between 1 and 65535, or ifhigh
is lower thanlow
.
-
PortRange
public PortRange(int port) Creates a port range containing a single port.- Parameters:
port
- port
-
-
Method Details
-
valueOf
Parse a port range. A port range consists of either a single integer, or two integers separated by either a comma or a colon. The bounds must be between 1 and 65535, both inclusive.- Parameters:
s
- either "number" or "number:number"- Returns:
- The port range represented by
s
. - Throws:
IllegalArgumentException
-
getLower
public int getLower() -
getUpper
public int getUpper() -
toString
-