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
- Author:
- rvesse
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGets whether the port range contains another port range i.e. does this cover at least the same range of ports as the otherintGets the maximum portintGets the minimum portbooleaninRange(int port) Gets whether a port falls within the rangetoString()
-
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: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
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
-
compareTo
- Specified by:
compareToin interfaceComparable<PortRange>
-