public class VersionRange extends Object
Version
range. A square bracket "[" or "]" denotes an inclusive end of
the range and a round bracket "(" or ")" denotes an exclusive end of the range. A range
can also be unbounded by defining a a single Version
. The examples below make
this clear.
Modifier | Constructor and Description |
---|---|
|
VersionRange(Version startingVersion) |
protected |
VersionRange(Version lowerVersion,
boolean lowerInclusive,
Version higherVersion,
boolean higherInclusive) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
VersionRange |
format(Version.Format format)
Format this version range to the specified
Version.Format . |
Version |
getHigherVersion() |
Version |
getLowerVersion() |
int |
hashCode() |
boolean |
isHigherInclusive() |
boolean |
isLowerInclusive() |
boolean |
match(Version version)
Specify if the
Version matches this range. |
String |
toRangeString() |
String |
toString() |
protected VersionRange(Version lowerVersion, boolean lowerInclusive, Version higherVersion, boolean higherInclusive)
public VersionRange(Version startingVersion)
public boolean match(Version version)
Version
matches this range. Returns true
if the
version is contained within this range, false
otherwise.version
- the version to checktrue
if the version matchespublic VersionRange format(Version.Format format)
Version.Format
.format
- the version format to usepublic Version getLowerVersion()
public boolean isLowerInclusive()
public Version getHigherVersion()
public boolean isHigherInclusive()
public String toRangeString()
Copyright © 2022 Pivotal Software, Inc.. All rights reserved.