Module com.github.rvesse.airline
Enum PortType
- java.lang.Object
-
- java.lang.Enum<PortType>
-
- com.github.rvesse.airline.annotations.restrictions.PortType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ANY
Any portDYNAMIC
The dynamic ports (aka private or ephemeral ports), these are ports49152
to65535
which are never assigned by the IANAOS_ALLOCATED
Port0
i.e.SYSTEM
The system (aka well known or privileged ports), these are ports1
to1023
and usually require adminstrative privilegesUSER
The user ports (aka registered ports), these are ports1024
to49151
and which may be registered and assigned by the IANA
-
Constructor Summary
Constructors Modifier Constructor Description private
PortType(int min, int max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(PortRange other)
Gets whether the port range contains another port range i.e.int
getMaximumPort()
Gets the maximum portint
getMinimumPort()
Gets the minimum portboolean
inRange(int port)
Gets whether a port falls within the rangestatic java.lang.String
toRangesString(java.util.Set<PortRange> acceptablePorts)
Gets a string denoting all the acceptable port rangesjava.lang.String
toString()
static PortType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static PortType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANY
public static final PortType ANY
Any port
-
OS_ALLOCATED
public static final PortType OS_ALLOCATED
Port0
i.e. the special port that has the OS allocate an available port
-
SYSTEM
public static final PortType SYSTEM
The system (aka well known or privileged ports), these are ports1
to1023
and usually require adminstrative privileges
-
USER
public static final PortType USER
The user ports (aka registered ports), these are ports1024
to49151
and which may be registered and assigned by the IANA
-
DYNAMIC
public static final PortType DYNAMIC
The dynamic ports (aka private or ephemeral ports), these are ports49152
to65535
which are never assigned by the IANA
-
-
Method Detail
-
values
public static PortType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PortType c : PortType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PortType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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
public boolean contains(PortRange other)
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<PortType>
-
toRangesString
public static java.lang.String toRangesString(java.util.Set<PortRange> acceptablePorts)
Gets a string denoting all the acceptable port ranges- Parameters:
acceptablePorts
- Port types- Returns:
- String detailing acceptable ranges
-
-