Class NetworkPortRange
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.NetworkPortRange
-
- All Implemented Interfaces:
Serializable
public final class NetworkPortRange extends Object implements Serializable
This class represents a port range as specified in thednsName
andipAddress
datatypes. The range may have upper and lower bounds, be specified by a single port number, or may be unbound.- Version:
- $Id: $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static NetworkPortRange
MAX
static int
MAX_NET_PORT_NUMBER
Maximum network socket port number (decimal).static int
MIN_NET_PORT_NUMBER
Minimum network socket port number (decimal).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class.static NetworkPortRange
getInstance(String value)
Creates an instance ofPortRange
based on the given value.int
getLowerBound()
Returns the lower-bound port value.int
getUpperBound()
Returns the upper-bound port value.int
hashCode()
String
toString()
-
-
-
Field Detail
-
MIN_NET_PORT_NUMBER
public static final int MIN_NET_PORT_NUMBER
Minimum network socket port number (decimal).- See Also:
- Constant Field Values
-
MAX_NET_PORT_NUMBER
public static final int MAX_NET_PORT_NUMBER
Maximum network socket port number (decimal).- See Also:
- Constant Field Values
-
MAX
public static final NetworkPortRange MAX
-
-
Method Detail
-
getInstance
public static NetworkPortRange getInstance(String value) throws IllegalArgumentException
Creates an instance ofPortRange
based on the given value.- Parameters:
value
- aString
representing the range, that may be null or empty for unlimited range, or a valid port range as defined by appendix A.2 for IP address and DNS name.- Returns:
- a new
PortRange
- Throws:
IllegalArgumentException
- if the port range syntax is not: portnumber | "-"portnumber | portnumber"-"[portnumber]; or one of the portnumber values is not a valid decimal number in the interval [0, 65535]
-
getLowerBound
public int getLowerBound()
Returns the lower-bound port value. If the range is not lower-bound, then this returnsUNBOUND
. If the range is actually a single port number, then this returns the same value asgetUpperBound
.- Returns:
- the upper-bound
-
getUpperBound
public int getUpperBound()
Returns the upper-bound port value. If the range is not upper-bound, then this returnsUNBOUND
. If the range is actually a single port number, then this returns the same value asgetLowerBound
.- Returns:
- the upper-bound
-
equals
public boolean equals(Object o)
Returns true if the input is an instance of this class and if its value equals the value contained in this class.
-
-