Inc

enum Inc : Enum<Inc>

Determines by which identifier the given Version should be incremented.

Samples

import io.github.z4kn4fein.semver.Inc
import io.github.z4kn4fein.semver.Version
import io.github.z4kn4fein.semver.constraints.toConstraint
import io.github.z4kn4fein.semver.inc
import io.github.z4kn4fein.semver.nextMajor
import io.github.z4kn4fein.semver.nextMinor
import io.github.z4kn4fein.semver.nextPatch
import io.github.z4kn4fein.semver.nextPreRelease
import io.github.z4kn4fein.semver.satisfies
import io.github.z4kn4fein.semver.satisfiesAll
import io.github.z4kn4fein.semver.satisfiesAny
import io.github.z4kn4fein.semver.toVersion
import io.github.z4kn4fein.semver.toVersionOrNull
import io.github.z4kn4fein.semver.withoutSuffixes
fun main() { 
   //sampleStart 
   val version = "1.0.0-alpha.1".toVersion()
println(version.inc(by = Inc.MAJOR))
println(version.inc(by = Inc.MINOR))
println(version.inc(by = Inc.PATCH))
println(version.inc(by = Inc.PRE_RELEASE))

println(version.inc(by = Inc.MAJOR, preRelease = ""))
println(version.inc(by = Inc.MINOR, preRelease = "beta")) 
   //sampleEnd
}

Entries

Link copied to clipboard

Indicates that the Version should be incremented by its PRE-RELEASE identifier.

Link copied to clipboard

Indicates that the Version should be incremented by its PATCH number.

Link copied to clipboard

Indicates that the Version should be incremented by its MINOR number.

Link copied to clipboard

Indicates that the Version should be incremented by its MAJOR number.

Properties

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int

Sources

Link copied to clipboard