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 intstatic final VersionRangeprivate final org.osgi.framework.Versionstatic final intprivate final org.osgi.framework.Versionstatic final org.osgi.framework.Versionstatic final intstatic final intstatic final intprivate final booleanprivate final booleanprivate 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 voidbooleancontains(org.osgi.framework.Version version) test a version to see if it falls in the rangebooleanorg.osgi.framework.Versionorg.osgi.framework.VersiongetFloor()inthashCode()booleanbooleanbooleanprivate static booleanisRangeValid(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 booleanisRemoveable(char ch) private StringmakeString(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling) static VersionRangenewInstance(org.osgi.framework.Version pointVersion, int lowerBoundRule, int upperBoundRule) static VersionRangeparseVersionRange(String val) private StringtoString()
-
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:
floor- the minimum version.openFloor- whether the minimum version is exclusive.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)
-