Package com.pulumi.automation
Class Version
java.lang.Object
com.pulumi.automation.Version
- All Implemented Interfaces:
Comparable<Version>
Represents a semantic version (SemVer).
-
Method Summary
Modifier and TypeMethodDescriptionintbooleaninthashCode()booleanisEquivalentTo(Version other) booleanisHigherThan(Version other) booleanbooleanisLowerThan(Version other) booleanisLowerThanOrEquivalentTo(Version other) longReturns the major version.longReturns the minor version.static Versionof(long major, long minor) Obtains aVersioninstance of the specified major, minor and patch versions.static Versionof(long major, long minor, long patch) Obtains aVersioninstance of the specified major, minor and patch versions.static VersionParses aVersionfrom the specified SemVer string.longReturns the patch version.toString()Parses aVersionfrom the specified SemVer string.
-
Method Details
-
of
Obtains aVersioninstance of the specified major, minor and patch versions.- Parameters:
major- a major version number, non-negativeminor- a minor version number, non-negative- Returns:
- the version
-
of
Obtains aVersioninstance of the specified major, minor and patch versions.- Parameters:
major- a major version number, non-negativeminor- a minor version number, non-negativepatch- a patch version number, non-negative- Returns:
- the version
-
parse
Parses aVersionfrom the specified SemVer string.- Parameters:
version- the SemVer string to parse- Returns:
- the version
-
tryParse
Parses aVersionfrom the specified SemVer string.- Parameters:
version- the SemVer string to parse- Returns:
- the version if it can be parsed; empty otherwise
-
majorVersion
public long majorVersion()Returns the major version.- Returns:
- the major version number
-
minorVersion
public long minorVersion()Returns the minor version.- Returns:
- the minor version number
-
patchVersion
public long patchVersion()Returns the patch version.- Returns:
- the patch version number
-
isHigherThan
-
isHigherThanOrEquivalentTo
-
isLowerThan
-
isLowerThanOrEquivalentTo
-
isEquivalentTo
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<Version>
-
toString
-