aboutsummaryrefslogtreecommitdiffstats
path: root/api/src/main/java/org/semver/Version.java
diff options
context:
space:
mode:
Diffstat (limited to 'api/src/main/java/org/semver/Version.java')
-rwxr-xr-xapi/src/main/java/org/semver/Version.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/api/src/main/java/org/semver/Version.java b/api/src/main/java/org/semver/Version.java
index 09046b8..4f73e4f 100755
--- a/api/src/main/java/org/semver/Version.java
+++ b/api/src/main/java/org/semver/Version.java
@@ -147,6 +147,15 @@ public final class Version implements Comparable<Version> {
}
}
+ /**
+ * if this is a pre-release version, returns the corresponding release
+ * return the same version if already a release
+ * @return a release version
+ */
+ public Version toReleaseVersion() {
+ return new Version(major, minor, patch);
+ }
+
public boolean isInDevelopment() {
return this.major == 0;
}