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 int
compareTo(@NotNull CoreVersion o)
boolean
equals(java.lang.Object o)
@NotNull java.lang.String
getFormatted()
This object represented as a short and human readable string.@NotNull java.math.BigInteger
getMajor()
The major version.@NotNull java.math.BigInteger
getMinor()
The minor version.@NotNull java.math.BigInteger
getPatch()
The patch versionint
hashCode()
java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
equals
@Contract(value="null -> false", pure=true) public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(@NotNull @NotNull CoreVersion o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<CoreVersion>
-
getFormatted
@NotNull public @NotNull java.lang.String getFormatted()
Description copied from interface:Formattable
This object represented as a short and human readable string.- Specified by:
getFormatted
in interfaceFormattable
- Returns:
- This object as a readable string.
-
-