public final class SemVer extends Object implements Comparable<SemVer>
Modifier and Type | Class and Description |
---|---|
static class |
SemVer.Suffix |
Constructor and Description |
---|
SemVer(int major,
int minor,
int patch,
@Nullable SemVer.Suffix suffix) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(@NonNull SemVer o) |
boolean |
equals(Object o) |
int |
getMajor() |
int |
getMinor() |
int |
getPatch() |
@Nullable SemVer.Suffix |
getSuffix() |
int |
hashCode() |
boolean |
isEquivalentTo(SemVer other)
Slightly different from
equals(java.lang.Object) in that this method will return
true if the suffix has the same weight
but not the same SemVer.Suffix.getText() text |
boolean |
isNewerThan(SemVer other) |
boolean |
isOlderThan(SemVer other) |
static @Nullable SemVer |
parse(@NonNull String text) |
String |
toFormattedString() |
String |
toString() |
public SemVer(int major, int minor, int patch, @Nullable SemVer.Suffix suffix)
public boolean isNewerThan(SemVer other)
public boolean isOlderThan(SemVer other)
public boolean isEquivalentTo(SemVer other)
equals(java.lang.Object)
in that this method will return
true if the suffix has the same weight
but not the same SemVer.Suffix.getText()
textother
- the version to compare withpublic int getMajor()
public int getMinor()
public int getPatch()
public @Nullable SemVer.Suffix getSuffix()
public int compareTo(@NonNull SemVer o)
compareTo
in interface Comparable<SemVer>
public String toFormattedString()