public class MultipleVersionRange extends Object implements VersionRange
| Constructor and Description |
|---|
MultipleVersionRange(VersionRange... ranges) |
| Modifier and Type | Method and Description |
|---|---|
MultipleVersionRange |
cloneOf() |
boolean |
equals(Object obj) |
Version |
getHighestMatch(List<Version> versions)
Return the highest
Version of the given List of versions that satisfies all VersionRange
instances in this MultipleVersionRange; otherwise, return null if no match was found. |
VersionRange |
getIntersection(VersionRange... ranges)
|
Version |
getMax()
Get the maximum
Version (never null.) |
Version |
getMin()
Get the minimum
Version (never null.) |
List<VersionRange> |
getRanges() |
int |
hashCode() |
boolean |
includes(Version version)
Return true if this
VersionRange includes the given Version. |
MultipleVersionRange |
intersect(MultipleVersionRange intersection)
Creates and returns a new
MultipleVersionRange that is a intersection of this version range and the
specified version range. |
boolean |
isEmpty()
Return
true if this VersionRange is empty. |
boolean |
isExact()
|
boolean |
isMaxInclusive()
Return
true if VersionRange.getMax() is inclusive. |
boolean |
isMinInclusive()
Return
true if VersionRange.getMin() is inclusive. |
Version |
matchLowestMatch(List<Version> versions) |
String |
toString() |
public MultipleVersionRange(VersionRange... ranges)
public List<VersionRange> getRanges()
public MultipleVersionRange cloneOf()
public MultipleVersionRange intersect(MultipleVersionRange intersection)
MultipleVersionRange that is a intersection of this version range and the
specified version range.
Note: Precedence is given to the recommended version from this version range over the recommended version from the specified version range.
intersection - the MultipleVersionRange that will be used to restrict this version range.MultipleVersionRange that is a intersection of this version range and the specified
version range.
The ranges of the returned version range will be an intersection of the ranges of this version range and the specified version range if both version ranges have ranges. Otherwise, the ranges on the returned range will be empty.
The recommended version of the returned version range will be the recommended version of this version
range, provided that ranges falls within the intersected ranges. If the ranges are empty, this version
range's recommended version is used if it is not null. If it is null, the
specified version range's recommended version is used (provided it is non-null). If no
recommended version can be obtained, the returned version range's recommended version is set to
null.
NullPointerException - if the specified MultipleVersionRange is null.public Version getHighestMatch(List<Version> versions)
Version of the given List of versions that satisfies all VersionRange
instances in this MultipleVersionRange; otherwise, return null if no match was found.public boolean includes(Version version)
VersionRangeVersionRange includes the given Version.includes in interface VersionRangepublic Version getMin()
VersionRangeVersion (never null.)getMin in interface VersionRangepublic boolean isMinInclusive()
VersionRangetrue if VersionRange.getMin() is inclusive.isMinInclusive in interface VersionRangepublic Version getMax()
VersionRangeVersion (never null.)getMax in interface VersionRangepublic boolean isMaxInclusive()
VersionRangetrue if VersionRange.getMax() is inclusive.isMaxInclusive in interface VersionRangepublic boolean isEmpty()
VersionRangetrue if this VersionRange is empty.isEmpty in interface VersionRangepublic boolean isExact()
VersionRangeisExact in interface VersionRangepublic VersionRange getIntersection(VersionRange... ranges)
VersionRangegetIntersection in interface VersionRangeCopyright © 2014 JBoss by Red Hat. All rights reserved.