Package ca.solostudios.strata.version
Class PreReleaseIdentifier
- java.lang.Object
-
- ca.solostudios.strata.version.PreReleaseIdentifier
-
- All Implemented Interfaces:
Formattable,java.lang.Comparable<PreReleaseIdentifier>
- Direct Known Subclasses:
PreReleaseIdentifier.AlphaNumericalPreReleaseIdentifier,PreReleaseIdentifier.NumericalPreReleaseIdentifier
public abstract class PreReleaseIdentifier extends java.lang.Object implements java.lang.Comparable<PreReleaseIdentifier>, Formattable
This class represents a pre-release identifier. There are only two implementations:PreReleaseIdentifier.NumericalPreReleaseIdentifierandPreReleaseIdentifier.AlphaNumericalPreReleaseIdentifier.Note: this class has a natural ordering that is inconsistent with equals.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreReleaseIdentifier.AlphaNumericalPreReleaseIdentifierAn alphanumerical identifier.static classPreReleaseIdentifier.NumericalPreReleaseIdentifierA numerical identifier.
-
Constructor Summary
Constructors Constructor Description PreReleaseIdentifier()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.math.BigIntegerasInteger()This identifier as an integer.protected abstract @NotNull java.lang.StringasString()This identifier formatted as a string.intcompareTo(@NotNull PreReleaseIdentifier o)@NotNull java.lang.StringgetFormatted()This object represented as a short and human readable string.protected abstract booleanisNumeric()Whether or not this identifier can contain numerical values.
-
-
-
Method Detail
-
compareTo
public int compareTo(@NotNull @NotNull PreReleaseIdentifier o)- Specified by:
compareToin interfacejava.lang.Comparable<PreReleaseIdentifier>
-
asInteger
protected java.math.BigInteger asInteger() throws java.lang.UnsupportedOperationExceptionThis identifier as an integer.- Returns:
- This identifier as an integer.
- Throws:
java.lang.UnsupportedOperationException- If this identifier cannot be formatted as an integer.
-
asString
@NotNull protected abstract @NotNull java.lang.String asString()
This identifier formatted as a string.- Returns:
- This identifier as a string.
-
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.
-
isNumeric
protected abstract boolean isNumeric()
Whether or not this identifier can contain numerical values.- Returns:
trueif this identifier can contain numerical values,falseotherwise.
-
-