Class Version
- java.lang.Object
-
- software.amazon.awssdk.eventstreamrpc.Version
-
- All Implemented Interfaces:
Comparable<Version>
public class Version extends Object implements Comparable<Version>
https://semver.org/ minus the labels
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version rhs)
boolean
equals(Object rhs)
static Version
fromString(String versionString)
Returns a new Version class from the given version string.static Version
getInstance()
String
getVersionString()
Returns the Version in string representation in the format: Major.Minor.Patch.int
hashCode()
String
toString()
-
-
-
Field Detail
-
PATTERN
public static final Pattern PATTERN
The Regex pattern used to parse versions from strings
-
MAJOR
public static final int MAJOR
Default major version number. Defaults to 0- See Also:
- Constant Field Values
-
MINOR
public static final int MINOR
Default minor version number. Defaults to 1- See Also:
- Constant Field Values
-
PATCH
public static final int PATCH
Default patch version number. Defaults to 0- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static Version getInstance()
- Returns:
- Returns an instance of the version
-
getVersionString
public String getVersionString()
Returns the Version in string representation in the format: Major.Minor.Patch.- Returns:
- The Version converted to a string
-
fromString
public static Version fromString(String versionString)
Returns a new Version class from the given version string. Will throw an exception if it cannot convert.- Parameters:
versionString
- The version string to convert- Returns:
- The Version class created from the string
-
compareTo
public int compareTo(Version rhs)
- Specified by:
compareTo
in interfaceComparable<Version>
-
-