Package com.amazonaws.services.ec2.model
Class PortRange
- java.lang.Object
-
- com.amazonaws.services.ec2.model.PortRange
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class PortRange extends Object implements Serializable, Cloneable
Describes a range of ports.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PortRange()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PortRange
clone()
boolean
equals(Object obj)
Integer
getFrom()
The first port in the range.Integer
getTo()
The last port in the range.int
hashCode()
void
setFrom(Integer from)
The first port in the range.void
setTo(Integer to)
The last port in the range.String
toString()
Returns a string representation of this object; useful for testing and debugging.PortRange
withFrom(Integer from)
The first port in the range.PortRange
withTo(Integer to)
The last port in the range.
-
-
-
Method Detail
-
setFrom
public void setFrom(Integer from)
The first port in the range.
- Parameters:
from
- The first port in the range.
-
getFrom
public Integer getFrom()
The first port in the range.
- Returns:
- The first port in the range.
-
withFrom
public PortRange withFrom(Integer from)
The first port in the range.
- Parameters:
from
- The first port in the range.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTo
public void setTo(Integer to)
The last port in the range.
- Parameters:
to
- The last port in the range.
-
getTo
public Integer getTo()
The last port in the range.
- Returns:
- The last port in the range.
-
withTo
public PortRange withTo(Integer to)
The last port in the range.
- Parameters:
to
- The last port in the range.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toString
in classObject
- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
-