VersionBuilder

A builder class for creating Version objects.

This class provides a fluent and expressive way to configure the properties of a Version object. You can use method chaining to set the major, minor, and patch version numbers, as well as the release flag, version qualifier, and deprecated flag. Once you have configured the properties you want, you can call the build() method to create a new Version object.

Example usage:

val versionBuilder = VersionBuilder()
.major(1)
.minor(2)
.patch(3)
.alphaRelease(4)
.build()

println(versionBuilder) // Output: 1.2.3-alpha04

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var major: Int

The major version number.

Link copied to clipboard
var minor: Int

The minor version number.

Link copied to clipboard
var patch: Int

The patch version number.

Functions

Link copied to clipboard

Sets the release flag to alpha and the version qualifier to the provided value.

Link copied to clipboard

Sets the release flag to beta and the version qualifier to the provided value.

Link copied to clipboard
fun build(): Version

Builds and returns a new Version object with the configured properties.

Link copied to clipboard

Marks the version as deprecated.

Link copied to clipboard

Sets the version qualifier to the provided value.

Link copied to clipboard
fun versionQualifierPadding(versionQualifierPadding: Int): Version.VersionBuilder

Sets the padding for the version qualifier to the provided value.