summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/sevenUnits/utils/SemanticVersionNumber.java')
-rw-r--r--src/main/java/sevenUnits/utils/SemanticVersionNumber.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
index a663a11..e80e16e 100644
--- a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
+++ b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
@@ -39,6 +39,7 @@ import java.util.regex.Pattern;
* are made
* </ol>
*
+ * @since v0.4.0
* @since 2022-02-19
*/
public final class SemanticVersionNumber
@@ -51,6 +52,7 @@ public final class SemanticVersionNumber
* throw NullPointerExceptions, everything else throws
* IllegalArgumentException.
*
+ * @since v0.4.0
* @since 2022-02-19
*/
public static final class Builder {
@@ -67,6 +69,7 @@ public final class SemanticVersionNumber
* @param major major version number of final version
* @param minor minor version number of final version
* @param patch patch version number of final version
+ * @since v0.4.0
* @since 2022-02-19
*/
private Builder(int major, int minor, int patch) {
@@ -79,6 +82,7 @@ public final class SemanticVersionNumber
/**
* @return version number created by this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public SemanticVersionNumber build() {
@@ -91,6 +95,7 @@ public final class SemanticVersionNumber
*
* @param identifiers build metadata
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder buildMetadata(List<String> identifiers) {
@@ -110,6 +115,7 @@ public final class SemanticVersionNumber
*
* @param identifiers build metadata
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder buildMetadata(String... identifiers) {
@@ -148,6 +154,7 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder preRelease(int... identifiers) {
@@ -166,6 +173,7 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder preRelease(List<String> identifiers) {
@@ -185,6 +193,7 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder preRelease(String... identifiers) {
@@ -205,6 +214,7 @@ public final class SemanticVersionNumber
* @param identifier1 first identifier
* @param identifier2 second identifier
* @return this builder
+ * @since v0.4.0
* @since 2022-02-19
*/
public Builder preRelease(String identifier1, int identifier2) {
@@ -270,6 +280,7 @@ public final class SemanticVersionNumber
* @param patch patch version number of final version
* @return version number builder
* @throws IllegalArgumentException if any argument is negative
+ * @since v0.4.0
* @since 2022-02-19
*/
public static final SemanticVersionNumber.Builder builder(int major,
@@ -293,6 +304,7 @@ public final class SemanticVersionNumber
* @param b second list
* @return result of comparison as in a comparator
* @see Comparator
+ * @since v0.4.0
* @since 2022-02-20
*/
private static final int compareIdentifiers(List<String> a, List<String> b) {
@@ -353,6 +365,7 @@ public final class SemanticVersionNumber
*
* @param versionString string to parse
* @return {@code SemanticVersionNumber} instance
+ * @since v0.4.0
* @since 2022-02-19
* @see {@link #toString}
*/
@@ -396,6 +409,7 @@ public final class SemanticVersionNumber
*
* @param versionString string to test
* @return true iff string is valid
+ * @since v0.4.0
* @since 2022-02-19
*/
public static final boolean isValidVersionString(String versionString) {
@@ -415,6 +429,7 @@ public final class SemanticVersionNumber
* @throws IllegalArgumentException if any argument is negative or if the
* preReleaseType is null, empty or not
* alphanumeric (0-9, A-Z, a-z, - only)
+ * @since v0.4.0
* @since 2022-02-19
*/
public static final SemanticVersionNumber preRelease(int major, int minor,
@@ -452,6 +467,7 @@ public final class SemanticVersionNumber
* @param patch patch version number
* @return {@code SemanticVersionNumber} instance
* @throws IllegalArgumentException if any argument is negative
+ * @since v0.4.0
* @since 2022-02-19
*/
public static final SemanticVersionNumber stableVersion(int major, int minor,
@@ -484,6 +500,7 @@ public final class SemanticVersionNumber
* @param patch patch version number
* @param preReleaseIdentifiers pre-release version data
* @param buildMetadata build metadata
+ * @since v0.4.0
* @since 2022-02-19
*/
private SemanticVersionNumber(int major, int minor, int patch,
@@ -497,6 +514,7 @@ public final class SemanticVersionNumber
/**
* @return build metadata (empty if there is none)
+ * @since v0.4.0
* @since 2022-02-19
*/
public List<String> buildMetadata() {
@@ -567,6 +585,7 @@ public final class SemanticVersionNumber
* @param other version to compare with
* @return true if you can definitely upgrade to {@code other} without
* changing code
+ * @since v0.4.0
* @since 2022-02-20
*/
public boolean compatibleWith(SemanticVersionNumber other) {
@@ -620,6 +639,7 @@ public final class SemanticVersionNumber
/**
* @return true iff this version is stable (major version > 0 and not a
* pre-release)
+ * @since v0.4.0
* @since 2022-02-19
*/
public boolean isStable() {
@@ -629,6 +649,7 @@ public final class SemanticVersionNumber
/**
* @return the MAJOR version number, incremented when you make backwards
* incompatible API changes
+ * @since v0.4.0
* @since 2022-02-19
*/
public int majorVersion() {
@@ -638,6 +659,7 @@ public final class SemanticVersionNumber
/**
* @return the MINOR version number, incremented when you add backwards
* compatible functionality
+ * @since v0.4.0
* @since 2022-02-19
*/
public int minorVersion() {
@@ -647,6 +669,7 @@ public final class SemanticVersionNumber
/**
* @return the PATCH version number, incremented when you make backwards
* compatible bug fixes
+ * @since v0.4.0
* @since 2022-02-19
*/
public int patchVersion() {
@@ -656,6 +679,7 @@ public final class SemanticVersionNumber
/**
* @return identifiers describing this pre-release (empty if not a
* pre-release)
+ * @since v0.4.0
* @since 2022-02-19
*/
public List<String> preReleaseIdentifiers() {
@@ -674,6 +698,7 @@ public final class SemanticVersionNumber
* 1, pre-release identifiers "alpha" and "1" and build metadata "2022-02-19"
* has a string representation "3.2.1-alpha.1+2022-02-19".
*
+ * @since v0.4.0
* @see <a href="https://semver.org">The official SemVer specification</a>
*/
@Override