java.lang.Object
com.aoapps.net.IPortRange
com.aoapps.net.PortRange
- All Implemented Interfaces:
DtoFactory<PortRange>,Serializable,Comparable<IPortRange>
A port range and associated protocol.
The range must represent at least two ports.
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Fields inherited from class com.aoapps.net.IPortRange
MAX_PORT, MIN_PORT -
Method Summary
Modifier and TypeMethodDescriptionbooleanUnlikePort, port ranges are not cached and may not be safely compared by identity.getDto()intgetFrom()Gets the first port number in the range.Gets the first port number in the range as aPort.intgetTo()Gets the last port number in the range.Gets the last port number in the range as aPort.inthashCode()splitAbove(int above) splitBelow(int below) toString()static ValidationResultstatic PortRangeMethods inherited from class com.aoapps.net.IPortRange
coalesce, compareTo, getProtocol, overlaps
-
Method Details
-
validate
-
valueOf
- Throws:
ValidationException
-
equals
UnlikePort, port ranges are not cached and may not be safely compared by identity.- Specified by:
equalsin classIPortRange
-
hashCode
public int hashCode()- Specified by:
hashCodein classIPortRange
-
toString
- Specified by:
toStringin classIPortRange- Returns:
- The port range and protocol, such as
53/UDPor8080-8087/TCP. - See Also:
-
getFrom
public int getFrom()Description copied from class:IPortRangeGets the first port number in the range.- Specified by:
getFromin classIPortRange
-
getFromPort
Description copied from class:IPortRangeGets the first port number in the range as aPort.- Specified by:
getFromPortin classIPortRange
-
getTo
public int getTo()Description copied from class:IPortRangeGets the last port number in the range.- Specified by:
getToin classIPortRange
-
getToPort
Description copied from class:IPortRangeGets the last port number in the range as aPort.- Specified by:
getToPortin classIPortRange
-
getDto
- Specified by:
getDtoin interfaceDtoFactory<PortRange>
-
splitBelow
- Specified by:
splitBelowin classIPortRange- Returns:
- The part of this port range below, and not including, the given port or
nullif none.
-
splitAbove
- Specified by:
splitAbovein classIPortRange- Returns:
- The part of this port range above, and not including, the given port or
nullif none.
-
