Package org.apache.felix.utils.version
Class VersionRange
java.lang.Object
org.apache.felix.utils.version.VersionRange
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final VersionRange
private final org.osgi.framework.Version
static final int
private final org.osgi.framework.Version
static final org.osgi.framework.Version
static final int
static final int
static final int
private final boolean
private final boolean
private static boolean[]
private static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVersionRange
(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) Interval constructorVersionRange
(String val) VersionRange
(String val, boolean exact) VersionRange
(String val, boolean exact, boolean clean) VersionRange
(org.osgi.framework.Version atLeast) atLeast constructorVersionRange
(org.osgi.framework.Version atLeast, boolean exact) atLeast constructor -
Method Summary
Modifier and TypeMethodDescriptionprivate void
boolean
contains
(org.osgi.framework.Version version) test a version to see if it falls in the rangeboolean
org.osgi.framework.Version
org.osgi.framework.Version
getFloor()
int
hashCode()
boolean
boolean
boolean
private static boolean
isRangeValid
(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) Check if the supplied parameters describe a valid version range.private boolean
isRemoveable
(char ch) private String
makeString
(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) static VersionRange
newInstance
(org.osgi.framework.Version pointVersion, int lowerBoundRule, int upperBoundRule) static VersionRange
parseVersionRange
(String val) private String
toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
INFINITE_VERSION
public static final org.osgi.framework.Version INFINITE_VERSION -
ANY_VERSION
-
EXACT
public static final int EXACT- See Also:
-
MICRO
public static final int MICRO- See Also:
-
MINOR
public static final int MINOR- See Also:
-
MAJOR
public static final int MAJOR- See Also:
-
ANY
public static final int ANY- See Also:
-
openFloor
private final boolean openFloor -
floor
private final org.osgi.framework.Version floor -
ceiling
private final org.osgi.framework.Version ceiling -
openCeiling
private final boolean openCeiling -
removeable
private static boolean[] removeable
-
-
Constructor Details
-
VersionRange
public VersionRange(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) Interval constructor- Parameters:
openFloor
- Whether the lower bound of the range is inclusive (false) or exclusive (true).floor
- The lower bound version of the range.ceiling
- The upper bound version of the range.openCeiling
- Whether the upper bound of the range is inclusive (false) or exclusive (true).
-
VersionRange
public VersionRange(org.osgi.framework.Version atLeast) atLeast constructor- Parameters:
atLeast
- Minimum version
-
VersionRange
public VersionRange(org.osgi.framework.Version atLeast, boolean exact) atLeast constructor- Parameters:
atLeast
- Minimum versionexact
- Exact range
-
VersionRange
-
VersionRange
public VersionRange(String val, boolean exact) throws IllegalArgumentException, NumberFormatException -
VersionRange
public VersionRange(String val, boolean exact, boolean clean) throws IllegalArgumentException, NumberFormatException
-
-
Method Details
-
removeQuotesAndWhitespaces
-
isRemoveable
private boolean isRemoveable(char ch) -
parseVersionRange
public static VersionRange parseVersionRange(String val) throws IllegalArgumentException, NumberFormatException -
getCeiling
public org.osgi.framework.Version getCeiling() -
getFloor
public org.osgi.framework.Version getFloor() -
isOpenCeiling
public boolean isOpenCeiling() -
isOpenFloor
public boolean isOpenFloor() -
isPointVersion
public boolean isPointVersion() -
contains
public boolean contains(org.osgi.framework.Version version) test a version to see if it falls in the range- Parameters:
version
- The version to check- Returns:
- Whether the version is within the range
-
intersect
-
isRangeValid
private static boolean isRangeValid(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) Check if the supplied parameters describe a valid version range.- Parameters:
openFloor
- whether the minimum version is exclusive.floor
- the minimum version.ceiling
- the maximum version.openCeiling
- whether the maximum version is exclusive.- Returns:
- true is the range is valid; otherwise false.
-
checkRange
private void checkRange() -
hashCode
public int hashCode() -
equals
-
toString
-
makeString
private String makeString(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) -
newInstance
public static VersionRange newInstance(org.osgi.framework.Version pointVersion, int lowerBoundRule, int upperBoundRule)
-