public class Versions extends Object
Version instances.| Constructor and Description |
|---|
Versions() |
| Modifier and Type | Method and Description |
|---|---|
static VersionRange |
intersection(Collection<VersionRange> ranges) |
static VersionRange |
intersection(VersionRange... ranges) |
static boolean |
isApiCompatible(Version runtimeVersion,
Version addonApiVersion)
This method only returns true if:
- The major version of addonApiVersion is equal to the major version of runtimeVersion AND
- The minor version of addonApiVersion is less or equal to the minor version of runtimeVersion
- The addonApiVersion is null
|
static boolean |
isSnapshot(Version version)
Returns if the version specified is a SNAPSHOT
|
static MultipleVersionRange |
parseMultipleVersionRange(String intersection)
Create a version range from a string representation
For example:
1.0 Version 1.0
[1.0,2.0) Versions 1.0 (included) to 2.0 (not included)
[1.0,2.0] Versions 1.0 to 2.0 (both included)
[1.5,) Versions 1.5 and higher
(,1.0],[1.2,) Versions up to 1.0 (included) and 1.2 or higher
|
static VersionRange |
parseVersionRange(String range) |
public static boolean isApiCompatible(Version runtimeVersion, Version addonApiVersion)
runtimeVersion - a version in the format x.x.xaddonApiVersion - a version in the format x.x.xpublic static MultipleVersionRange parseMultipleVersionRange(String intersection) throws VersionException
1.0 Version 1.0[1.0,2.0) Versions 1.0 (included) to 2.0 (not included)[1.0,2.0] Versions 1.0 to 2.0 (both included)[1.5,) Versions 1.5 and higher(,1.0],[1.2,) Versions up to 1.0 (included) and 1.2 or higherintersection - string representation of a version or version rangeMultipleVersionRange object that represents the specificationVersionExceptionpublic static VersionRange parseVersionRange(String range) throws VersionException
VersionExceptionpublic static VersionRange intersection(VersionRange... ranges)
public static VersionRange intersection(Collection<VersionRange> ranges)
public static boolean isSnapshot(Version version)
version - cannot be nullCopyright © 2014 JBoss by Red Hat. All rights reserved.