Enum Class PortType
- All Implemented Interfaces:
PortRange, Serializable, Comparable<PortType>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAny portThe dynamic ports (aka private or ephemeral ports), these are ports49152to65535which are never assigned by the IANAPort0i.e.The system (aka well known or privileged ports), these are ports1to1023and usually require adminstrative privilegesThe user ports (aka registered ports), these are ports1024to49151and which may be registered and assigned by the IANA -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets whether the port range contains another port range i.e.intGets the maximum portintGets the minimum portbooleaninRange(int port) Gets whether a port falls within the rangestatic StringtoRangesString(Set<PortRange> acceptablePorts) Gets a string denoting all the acceptable port rangestoString()static PortTypeReturns the enum constant of this class with the specified name.static PortType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ANY
Any port -
OS_ALLOCATED
Port0i.e. the special port that has the OS allocate an available port -
SYSTEM
The system (aka well known or privileged ports), these are ports1to1023and usually require adminstrative privileges -
USER
The user ports (aka registered ports), these are ports1024to49151and which may be registered and assigned by the IANA -
DYNAMIC
The dynamic ports (aka private or ephemeral ports), these are ports49152to65535which are never assigned by the IANA
-
-
Field Details
-
min
private final int min -
max
private final int max
-
-
Constructor Details
-
PortType
private PortType(int min, int max)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getMinimumPort
public int getMinimumPort()Description copied from interface:PortRangeGets the minimum port- Specified by:
getMinimumPortin interfacePortRange- Returns:
- Minimum port
-
getMaximumPort
public int getMaximumPort()Description copied from interface:PortRangeGets the maximum port- Specified by:
getMaximumPortin interfacePortRange- Returns:
- Maximum port
-
inRange
-
contains
Description copied from interface:PortRangeGets whether the port range contains another port range i.e. does this cover at least the same range of ports as the other -
toString
-
toRangesString
-