public class Version extends Object implements Comparable<Version>
| Modifier and Type | Class and Description |
|---|---|
static class |
Version.Builder |
static class |
Version.Identifier |
| Modifier and Type | Method and Description |
|---|---|
static Version.Builder |
builder() |
int |
compareTo(Version o) |
boolean |
equals(Object o) |
static Comparator<Version> |
forwardComparator() |
static Version |
fromString(String version) |
List<Version.Identifier> |
getBuildIdentifiers() |
int |
getMajor() |
int |
getMinor() |
int |
getPatch() |
List<Version.Identifier> |
getPreReleaseIdentifiers() |
int |
hashCode() |
Version |
incrementMajor() |
Version |
incrementMinor() |
Version |
incrementPatch() |
static String |
maxSatisfying(Collection<String> versionsToTest,
String range)
Returns the maximum version from a given collection of versions that satisfies a given range.
|
static Version |
maxVersionSatisfying(Collection<Version> versions,
String range) |
static Comparator<Version> |
reverseComparator() |
boolean |
satisfies(String expression) |
String |
toString() |
public int getMajor()
public int getMinor()
public int getPatch()
public List<Version.Identifier> getPreReleaseIdentifiers()
public List<Version.Identifier> getBuildIdentifiers()
public Version incrementMajor()
public Version incrementMinor()
public Version incrementPatch()
public boolean satisfies(String expression)
public static Version maxVersionSatisfying(Collection<Version> versions, String range)
public static String maxSatisfying(Collection<String> versionsToTest, String range)
versionsToTest - The collection of versions to test against the rangerange - A range, specified in node semver range format (eg. "<1.0.2 || >1.3")public static Version.Builder builder()
public int compareTo(Version o)
compareTo in interface Comparable<Version>public static final Comparator<Version> forwardComparator()
public static final Comparator<Version> reverseComparator()
Copyright © 2016. All rights reserved.