Class SaltVersion
java.lang.Object
com.suse.salt.netapi.datatypes.SaltVersion
- All Implemented Interfaces:
Comparable<SaltVersion>
Represents a salt version
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final intprivate static Patternprivate final int -
Constructor Summary
ConstructorsConstructorDescriptionSaltVersion(int year, int month, int bugfix) Creates a SaltVersion without release candidate tagSaltVersion(int year, int month, int bugfix, int releaseCandidate) Creates a SaltVersionSaltVersion(int year, int month, int bugfix, Optional<Integer> releaseCandidate) Creates a SaltVersion -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(SaltVersion other) intGetter for the bugfix of this SaltVersionintgetMonth()Getter for the month of this SaltVersionGetter for the release candidate of this SaltVersionintgetYear()Getter for the year of this SaltVersionstatic Optional<SaltVersion> Parses a salt version stringtoString()
-
Field Details
-
SALT_VERSION_REGEX
-
year
private final int year -
month
private final int month -
bugfix
private final int bugfix -
releaseCandidate
-
-
Constructor Details
-
SaltVersion
-
SaltVersion
public SaltVersion(int year, int month, int bugfix, int releaseCandidate) Creates a SaltVersion- Parameters:
year- Year of the releasemonth- Month of the releasebugfix- Bugfix number incremented withing a feature releasereleaseCandidate- release candidate tag
-
SaltVersion
public SaltVersion(int year, int month, int bugfix) Creates a SaltVersion without release candidate tag- Parameters:
year- Year of the releasemonth- Month of the releasebugfix- Bugfix number incremented withing a feature release
-
-
Method Details
-
parse
Parses a salt version string- Parameters:
versionString- the salt version string- Returns:
- SaltVersion if the versionString is valid or empty Optional if not.
-
getReleaseCandidate
-
getYear
public int getYear()Getter for the year of this SaltVersion- Returns:
- the year
-
getMonth
public int getMonth()Getter for the month of this SaltVersion- Returns:
- the month
-
getBugfix
public int getBugfix()Getter for the bugfix of this SaltVersion- Returns:
- the bugfix number
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<SaltVersion>
-