Version

constructor(major: Int, minor: Int, patch: Int, flag: ReleaseStatus = ReleaseStatus.Stable, isDeprecated: Boolean = false, versionQualifier: Int = 0, versionQualifierPadding: Int = 2)

Parameters

major

The major version number.

minor

The minor version number.

patch

The patch version number.

flag

The release flag, indicating whether the version is an alpha or beta release (default: None).

isDeprecated

Whether the version is deprecated (default: false).

versionQualifier

The version qualifier for alpha or beta releases (default: 0).

versionQualifierPadding

The padding for the version qualifier (default: 2).

TODO Create an interface called Version that can be used to represent different types of versions, such as date versions and number versions

  • DateVersion : Version Example: DateVersion(2023, 11, 02)

  • NumericVersion : Version Example: NumericVersion(10, 3, 4)

TODO: Create an interface called Version that can be used to represent different types of versions, such as date versions and numeric versions.

Tasks:

  • Create an interface called Version.

  • Create a class called DateVersion that implements the Version interface.

  • Add the following properties to the DateVersion class:

    • year: The year of the version.

    • month: The month of the version.

    • day: The day of the version.

  • Create a class called NumericVersion that implements the Version interface.

  • Add the following properties to the NumericVersion class:

    • major: The major version number.

    • minor: The minor version number.

    • patch: The patch version number.

  • Update the interface to reference the new DateVersion and NumericVersion classes.

Examples: // Example of a date version val dateVersion = DateVersion(2023, 11, 2) // Example of a number version val numericVersion = NumericVersion(10, 3, 4)