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 ANYAny portDYNAMICThe dynamic ports (aka private or ephemeral ports), these are ports49152to65535which are never assigned by the IANAOS_ALLOCATEDPort0i.e.SYSTEMThe system (aka well known or privileged ports), these are ports1to1023and usually require adminstrative privilegesUSERThe user ports (aka registered ports), these are ports1024to49151and which may be registered and assigned by the IANA
-
Constructor Summary
Constructors Modifier Constructor Description privatePortType(int min, int max)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(PortRange other)Gets whether the port range contains another port range i.e.intgetMaximumPort()Gets the maximum portintgetMinimumPort()Gets the minimum portbooleaninRange(int port)Gets whether a port falls within the rangestatic java.lang.StringtoRangesString(java.util.Set<PortRange> acceptablePorts)Gets a string denoting all the acceptable port rangesjava.lang.StringtoString()static PortTypevalueOf(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
Port0i.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 ports1to1023and usually require adminstrative privileges
-
USER
public static final PortType USER
The user ports (aka registered ports), these are ports1024to49151and 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 ports49152to65535which 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: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
public boolean inRange(int port)
Description copied from interface:PortRangeGets whether a port falls within the range
-
contains
public boolean contains(PortRange other)
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
public java.lang.String toString()
- Overrides:
toStringin 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
-
-