Package com.pulumi.automation
Class Version
- java.lang.Object
-
- com.pulumi.automation.Version
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version o)
boolean
equals(java.lang.Object o)
int
hashCode()
boolean
isEquivalentTo(Version other)
boolean
isHigherThan(Version other)
boolean
isHigherThanOrEquivalentTo(Version other)
boolean
isLowerThan(Version other)
boolean
isLowerThanOrEquivalentTo(Version other)
long
majorVersion()
Returns the major version.long
minorVersion()
Returns the minor version.static Version
of(long major, long minor)
Obtains aVersion
instance of the specified major, minor and patch versions.static Version
of(long major, long minor, long patch)
Obtains aVersion
instance of the specified major, minor and patch versions.static Version
parse(java.lang.String version)
Parses aVersion
from the specified SemVer string.long
patchVersion()
Returns the patch version.java.lang.String
toString()
static java.util.Optional<Version>
tryParse(java.lang.String version)
Parses aVersion
from the specified SemVer string.
-
-
-
Method Detail
-
of
public static Version of(long major, long minor)
Obtains aVersion
instance 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
public static Version of(long major, long minor, long patch)
Obtains aVersion
instance 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
public static Version parse(java.lang.String version)
Parses aVersion
from the specified SemVer string.- Parameters:
version
- the SemVer string to parse- Returns:
- the version
-
tryParse
public static java.util.Optional<Version> tryParse(java.lang.String version)
Parses aVersion
from 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
public boolean isHigherThan(Version other)
-
isHigherThanOrEquivalentTo
public boolean isHigherThanOrEquivalentTo(Version other)
-
isLowerThan
public boolean isLowerThan(Version other)
-
isLowerThanOrEquivalentTo
public boolean isLowerThanOrEquivalentTo(Version other)
-
isEquivalentTo
public boolean isEquivalentTo(Version other)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(Version o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Version>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-