Package org.apache.felix.utils.version

# Class VersionRange

java.lang.Object
org.apache.felix.utils.version.VersionRange

All Implemented Interfaces:
  `Serializable`

public class VersionRange extends Object implements Serializable

See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ANY`
`static final VersionRange`
`ANY_VERSION`
`static final int`
`EXACT`
`static final org.osgi.framework.Version`
`INFINITE_VERSION`
`static final int`
`MAJOR`
`static final int`
`MICRO`
`static final int`
`MINOR`

## Constructor Summary

Constructors
Constructor
Description
`VersionRange(boolean openFloor, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean openCeiling)`
Interval constructor
`VersionRange(String val)`
`VersionRange(String val, boolean exact)`
`VersionRange(String val, boolean exact, boolean clean)`
`VersionRange(org.osgi.framework.Version atLeast)`
atLeast constructor
`VersionRange(org.osgi.framework.Version atLeast, boolean exact)`
atLeast constructor

## Method Summary

Modifier and Type
Method
Description
`boolean`
`contains(org.osgi.framework.Version version)`
test a version to see if it falls in the range
`boolean`
`equals(Object obj)`
`org.osgi.framework.Version`
`getCeiling()`
`org.osgi.framework.Version`
`getFloor()`
`int`
`hashCode()`
`VersionRange`
`intersect(VersionRange r)`
`boolean`
`isOpenCeiling()`
`boolean`
`isOpenFloor()`
`boolean`
`isPointVersion()`
`static VersionRange`
`newInstance(org.osgi.framework.Version pointVersion, int lowerBoundRule, int upperBoundRule)`
`static VersionRange`
`parseVersionRange(String val)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### INFINITE_VERSION

public static final org.osgi.framework.Version INFINITE_VERSION

### ANY_VERSION

public static final VersionRange ANY_VERSION

### EXACT

public static final int EXACT

See Also:
  - Constant Field Values

### MICRO

public static final int MICRO

See Also:
  - Constant Field Values

### MINOR

public static final int MINOR

See Also:
  - Constant Field Values

### MAJOR

public static final int MAJOR

See Also:
  - Constant Field Values

### ANY

public static final int ANY

See Also:
  - Constant Field Values

## 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 version
  `exact` - Exact range

### VersionRange

public VersionRange(String val) throws IllegalArgumentException, NumberFormatException

Throws:
  `IllegalArgumentException`
  `NumberFormatException`

### VersionRange

public VersionRange(String val, boolean exact) throws IllegalArgumentException, NumberFormatException

Throws:
  `IllegalArgumentException`
  `NumberFormatException`

### VersionRange

public VersionRange(String val, boolean exact, boolean clean) throws IllegalArgumentException, NumberFormatException

Throws:
  `IllegalArgumentException`
  `NumberFormatException`

## Method Details

### parseVersionRange

public static VersionRange parseVersionRange(String val) throws IllegalArgumentException, NumberFormatException

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

public VersionRange intersect(VersionRange r)

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### newInstance

public static VersionRange newInstance(org.osgi.framework.Version pointVersion, int lowerBoundRule, int upperBoundRule)