Package ca.solostudios.strata.version
Class CoreVersion
- java.lang.Object
-
- ca.solostudios.strata.version.CoreVersion
-
- All Implemented Interfaces:
Formattable,java.lang.Comparable<CoreVersion>
public final class CoreVersion extends java.lang.Object implements java.lang.Comparable<CoreVersion>, Formattable
-
-
Constructor Summary
Constructors Constructor Description CoreVersion(@NotNull java.math.BigInteger major, @NotNull java.math.BigInteger minor, @NotNull java.math.BigInteger patch)Constructs a new core version instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(@NotNull CoreVersion o)booleanequals(java.lang.Object o)@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 versioninthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
CoreVersion
public CoreVersion(@NotNull @NotNull java.math.BigInteger major, @NotNull @NotNull java.math.BigInteger minor, @NotNull @NotNull java.math.BigInteger patch)Constructs a new core version instance.- Parameters:
major- The major version.minor- The minor version.patch- The patch version.
-
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
@Contract(value="null -> false", pure=true) public boolean equals(java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull CoreVersion o)- Specified by:
compareToin interfacejava.lang.Comparable<CoreVersion>
-
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.
-
-