Package ca.solostudios.strata.version
Class Version
- java.lang.Object
-
- ca.solostudios.strata.version.Version
-
- All Implemented Interfaces:
Formattable,java.lang.Comparable<Version>
public final class Version extends java.lang.Object implements java.lang.Comparable<Version>, Formattable
Class representing a version.
-
-
Constructor Summary
Constructors Constructor Description Version(@NotNull CoreVersion coreVersion, @NotNull PreRelease preRelease, @NotNull BuildMetadata buildMetadata)Constructs a new version with the provided core, pre-release, and build data, values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull Version o)booleanequals(@Nullable java.lang.Object o)@NotNull BuildMetadatagetBuildMetadata()The build metadata.@NotNull CoreVersiongetCoreVersion()The core version.@NotNull java.lang.StringgetFormatted()This object represented as a short and human readable string.@NotNull java.math.BigIntegergetMajor()The major version.@NotNull java.math.BigIntegergetMinor()The minor version.@NotNull java.math.BigIntegergetPatch()The patch version.@NotNull PreReleasegetPreRelease()The pre-release version.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
Version
@Contract(pure=true) public Version(@NotNull @NotNull CoreVersion coreVersion, @NotNull @NotNull PreRelease preRelease, @NotNull @NotNull BuildMetadata buildMetadata)Constructs a new version with the provided core, pre-release, and build data, values.- Parameters:
coreVersion- The core version.preRelease- The pre-release version.buildMetadata- The build data.
-
-
Method Detail
-
getMajor
@NotNull @Contract(pure=true) public @NotNull java.math.BigInteger getMajor()
The major version.- Returns:
- The major version.
-
getMinor
@NotNull @Contract(pure=true) public @NotNull java.math.BigInteger getMinor()
The minor version.- Returns:
- The minor version.
-
getPatch
@NotNull @Contract(pure=true) public @NotNull java.math.BigInteger getPatch()
The patch version.- Returns:
- The patch version.
-
getCoreVersion
@NotNull @Contract(pure=true) public @NotNull CoreVersion getCoreVersion()
The core version.- Returns:
- The core version.
-
getPreRelease
@NotNull @Contract(pure=true) public @NotNull PreRelease getPreRelease()
The pre-release version.- Returns:
- The pre-release version.
-
getBuildMetadata
@NotNull @Contract(pure=true) public @NotNull BuildMetadata getBuildMetadata()
The build metadata.- Returns:
- The build metadata.
-
toString
@Contract(pure=true) public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
@Contract(value="null -> false", pure=true) public boolean equals(@Nullable @Nullable java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull Version o)- Specified by:
compareToin interfacejava.lang.Comparable<Version>
-
getFormatted
@NotNull public @NotNull java.lang.String getFormatted()
Description copied from interface:FormattableThis object represented as a short and human readable string.- Specified by:
getFormattedin interfaceFormattable- Returns:
- This object as a readable string.
-
-