Package org.identityconnectors.common
Class VersionRange
java.lang.Object
org.identityconnectors.common.VersionRange
A version range is an interval describing a set of
versions
.
A range has a left (lower) endpoint and a right (upper) endpoint. Each endpoint can be open (excluded from the set) or closed (included in the set).
VersionRange
objects are immutable.
- Since:
- 1.4
-
Field Summary
Modifier and TypeFieldDescriptionstatic final char
The left endpoint is closed and is included in the range.static final char
The left endpoint is open and is excluded from the range.static final char
The right endpoint is closed and is included in the range.static final char
The right endpoint is open and is excluded from the range. -
Constructor Summary
ConstructorDescriptionVersionRange
(Version low, boolean isLowInclusive, Version high, boolean isHighInclusive) -
Method Summary
Modifier and TypeMethodDescriptionboolean
getFloor()
int
hashCode()
boolean
boolean
isEmpty()
Returns whether this version range is empty.boolean
isExact()
Returns whether this version range contains only a single version.boolean
boolean
static VersionRange
Creates a version range from the specified string.toString()
-
Field Details
-
LEFT_OPEN
public static final char LEFT_OPENThe left endpoint is open and is excluded from the range.The value of
LEFT_OPEN
is'('
.- See Also:
-
LEFT_CLOSED
public static final char LEFT_CLOSEDThe left endpoint is closed and is included in the range.The value of
LEFT_CLOSED
is'['
.- See Also:
-
RIGHT_OPEN
public static final char RIGHT_OPENThe right endpoint is open and is excluded from the range.The value of
RIGHT_OPEN
is')'
.- See Also:
-
RIGHT_CLOSED
public static final char RIGHT_CLOSEDThe right endpoint is closed and is included in the range.The value of
RIGHT_CLOSED
is']'
.- See Also:
-
-
Constructor Details
-
VersionRange
-
-
Method Details
-
parse
Creates a version range from the specified string.Version range string grammar:
range ::= interval | at least interval ::= ( '[' | '(' ) left ',' right ( ']' | ')' ) left ::= version right ::= version at least ::= version
- Parameters:
range
- String representation of the version range. The versions in the range must contain no whitespace. Other whitespace in the range string is ignored.- Throws:
IllegalArgumentException
- Ifrange
is improperly formatted.
-
getFloor
-
isFloorInclusive
public boolean isFloorInclusive() -
getCeiling
-
isCeilingInclusive
public boolean isCeilingInclusive() -
isInRange
-
isExact
public boolean isExact()Returns whether this version range contains only a single version.- Returns:
true
if this version range contains only a single version;false
otherwise.
-
isEmpty
public boolean isEmpty()Returns whether this version range is empty. A version range is empty if the set of versions defined by the interval is empty.- Returns:
true
if this version range is empty;false
otherwise.
-
equals
-
hashCode
public int hashCode() -
toString
-