public class PortRange extends Object
| Constructor and Description |
|---|
PortRange(int port)
Creates a port range containing a single port.
|
PortRange(int low,
int high)
Creates a port range with the given bounds (both inclusive).
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLower() |
int |
getUpper() |
String |
toString() |
static PortRange |
valueOf(String s)
Parse a port range.
|
public PortRange(int low,
int high)
low - start of port rangehigh - end of port rangeIllegalArgumentException - is either bound is not between 1 and 65535, or if high is lower than
low.public PortRange(int port)
port - portpublic static PortRange valueOf(String s) throws IllegalArgumentException
s - either "number" or "number:number"s.IllegalArgumentExceptionpublic int getLower()
public int getUpper()
Copyright © 2017–2020 Oracle Corporation. All rights reserved.