public class VersionRange extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Version version)
Returns true if the version is within the bounds of this
VersionRange . |
boolean |
equals(Object object) |
Version |
getLowerBounds()
Returns the lower, inclusive, bounds of the range.
|
Version |
getUpperBounds()
Returns the upper, exclusive, bounds of the range.
|
int |
hashCode() |
static VersionRange |
maximum(Version maxVersion)
Returns a
VersionRange that is only limited by a maximum version. |
static VersionRange |
minimum(Version minVersion)
Returns a
VersionRange that is only limited by a minimum version. |
static VersionRange |
range(Version minVersion,
Version maxVersion)
Returns a
VersionRange based on the minimum and maximum versions
provided. |
String |
toString() |
public static VersionRange maximum(Version maxVersion)
VersionRange
that is only limited by a maximum version.
The minimum version is set to Version.VERSION_0
.maxVersion
- The maximum version in the range. If null
then
null
is returned.public static VersionRange minimum(Version minVersion)
VersionRange
that is only limited by a minimum version.
The maximum version is set to Version.UNKNOWN
.minVersion
- The minimum version in the range. If null
then
null
is returned.public static VersionRange range(Version minVersion, Version maxVersion)
VersionRange
based on the minimum and maximum versions
provided.
If minVersion
and maxVersion
are both null
then null
is returned.
If only minVersion
is null
then the lower bound is
set to Version.VERSION_0
.
If only maxVersion
is null
then the upper bound is
set to Version.UNKNOWN
.
minVersion
- The minimum version in the range. If null
then
null
is returned.maxVersion
- The maximum version in the range. If null
then
null
is returned.public boolean contains(Version version)
VersionRange
.version
- The version to check if it is within range.VersionRange
.public boolean equals(Object object)
Overridden to compare this VersionRange
to the other.
public Version getLowerBounds()
public Version getUpperBounds()
public int hashCode()
Overridden to hash the version range.
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.