Class SemanticVersion
-
- All Implemented Interfaces:
-
kotlin.Comparable
public final class SemanticVersion implements Comparable<SemanticVersion>
A class representing semantic versions: major.minor.patch-preRelease+buildMetadata.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSemanticVersion.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static StringsemVerRegexStringprivate final BooleanisStableprivate final ULongmajorprivate final ULongminorprivate final ULongpatchprivate final PreReleaseIdentifierpreReleaseprivate final PreReleaseIdentifierbuildMetadatapublic final static SemanticVersion.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description SemanticVersion(String major, String minor, String patch, String preRelease, String buildMetadata)SemanticVersion(ULong major, ULong minor, ULong patch, PreReleaseIdentifier preRelease, PreReleaseIdentifier buildMetadata)
-
Method Summary
Modifier and Type Method Description final BooleanisStable()final ULonggetMajor()final ULonggetMinor()final ULonggetPatch()final PreReleaseIdentifiergetPreRelease()final PreReleaseIdentifiergetBuildMetadata()final SemanticVersionincrementMajor()Creates a new SemanticVersion with the major version increased by 1 and the minor and patch reset to 0. final SemanticVersionincrementMinor()Creates a new SemanticVersion with the minor version increased by 1 and the patch reset to 0, while keeping the major version. final SemanticVersionincrementPatch()Creates a new SemanticVersion with the patch version increased by 1, while keeping the major and minor versions. StringtoString()final SemanticVersionwithoutBuildMetadata()Creates the same SemanticVersion, but without build metadata. IntegercompareTo(SemanticVersion other)-
-
Constructor Detail
-
SemanticVersion
SemanticVersion(String major, String minor, String patch, String preRelease, String buildMetadata)
-
SemanticVersion
SemanticVersion(ULong major, ULong minor, ULong patch, PreReleaseIdentifier preRelease, PreReleaseIdentifier buildMetadata)
-
-
Method Detail
-
getPreRelease
final PreReleaseIdentifier getPreRelease()
-
getBuildMetadata
final PreReleaseIdentifier getBuildMetadata()
-
incrementMajor
final SemanticVersion incrementMajor()
Creates a new SemanticVersion with the major version increased by 1 and the minor and patch reset to 0.
-
incrementMinor
final SemanticVersion incrementMinor()
Creates a new SemanticVersion with the minor version increased by 1 and the patch reset to 0, while keeping the major version.
-
incrementPatch
final SemanticVersion incrementPatch()
Creates a new SemanticVersion with the patch version increased by 1, while keeping the major and minor versions.
-
withoutBuildMetadata
final SemanticVersion withoutBuildMetadata()
Creates the same SemanticVersion, but without build metadata.
-
compareTo
Integer compareTo(SemanticVersion other)
-
-
-
-