Module com.github.rvesse.airline
Class PortRangeImpl
java.lang.Object
com.github.rvesse.airline.restrictions.common.PortRangeImpl
- All Implemented Interfaces:
PortRange
,Comparable<PortRange>
Concrete implementation of a port range
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
min
private final int min -
max
private final int max
-
-
Constructor Details
-
PortRangeImpl
public PortRangeImpl(int min, int max) Creates a new port range- Parameters:
min
- Minimummax
- Maximum
-
-
Method Details
-
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
-
compareTo
- Specified by:
compareTo
in interfaceComparable<PortRange>
-