Inc

enum Inc : Enum<Inc> (source)

Determines by which identifier the given Version should be incremented.

Samples

import io.github.z4kn4fein.semver.Inc
import io.github.z4kn4fein.semver.LooseVersionSerializer
import io.github.z4kn4fein.semver.Version
import io.github.z4kn4fein.semver.VersionSerializer
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
import kotlinx.serialization.json.Json

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 MAJOR 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 PATCH number.

Link copied to clipboard

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

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun valueOf(value: String): Inc

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard
fun values(): Array<Inc>

Returns an array containing the constants of this enum type, in the order they're declared.