Module com.github.rvesse.airline
Enum Class PortType
- All Implemented Interfaces:
PortRange
,Serializable
,Comparable<PortType>
,Constable
Port types
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAny portThe dynamic ports (aka private or ephemeral ports), these are ports49152
to65535
which are never assigned by the IANAPort0
i.e.The system (aka well known or privileged ports), these are ports1
to1023
and usually require adminstrative privilegesThe user ports (aka registered ports), these are ports1024
to49151
and which may be registered and assigned by the IANA -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets whether the port range contains another port range i.e.int
Gets the maximum portint
Gets the minimum portboolean
inRange
(int port) Gets whether a port falls within the rangestatic String
toRangesString
(Set<PortRange> acceptablePorts) Gets a string denoting all the acceptable port rangestoString()
static PortType
Returns 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
Port0
i.e. the special port that has the OS allocate an available port -
SYSTEM
The system (aka well known or privileged ports), these are ports1
to1023
and usually require adminstrative privileges -
USER
The user ports (aka registered ports), these are ports1024
to49151
and which may be registered and assigned by the IANA -
DYNAMIC
The dynamic ports (aka private or ephemeral ports), these are ports49152
to65535
which 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:PortRange
Gets the minimum port- Specified by:
getMinimumPort
in interfacePortRange
- Returns:
- Minimum port
-
getMaximumPort
public int getMaximumPort()Description copied from interface:PortRange
Gets the maximum port- Specified by:
getMaximumPort
in interfacePortRange
- Returns:
- Maximum port
-
inRange
public boolean inRange(int port) Description copied from interface:PortRange
Gets whether a port falls within the range -
contains
Description copied from interface:PortRange
Gets 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
Gets a string denoting all the acceptable port ranges- Parameters:
acceptablePorts
- Port types- Returns:
- String detailing acceptable ranges
-