public class PortRange
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Describes a range of ports.
Modifier and Type | Field and Description |
---|---|
private java.lang.Integer |
from
The first port in the range.
|
private java.lang.Integer |
to
The last port in the range.
|
Constructor and Description |
---|
PortRange() |
Modifier and Type | Method and Description |
---|---|
PortRange |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.Integer |
getFrom()
The first port in the range.
|
java.lang.Integer |
getTo()
The last port in the range.
|
int |
hashCode() |
void |
setFrom(java.lang.Integer from)
The first port in the range.
|
void |
setTo(java.lang.Integer to)
The last port in the range.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
PortRange |
withFrom(java.lang.Integer from)
The first port in the range.
|
PortRange |
withTo(java.lang.Integer to)
The last port in the range.
|
private java.lang.Integer from
The first port in the range.
private java.lang.Integer to
The last port in the range.
public void setFrom(java.lang.Integer from)
The first port in the range.
from
- The first port in the range.public java.lang.Integer getFrom()
The first port in the range.
public PortRange withFrom(java.lang.Integer from)
The first port in the range.
from
- The first port in the range.public void setTo(java.lang.Integer to)
The last port in the range.
to
- The last port in the range.public java.lang.Integer getTo()
The last port in the range.
public PortRange withTo(java.lang.Integer to)
The last port in the range.
to
- The last port in the range.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public PortRange clone()
clone
in class java.lang.Object