Class SemanticVersion

java.lang.Object
org.ek9lang.core.SemanticVersion
All Implemented Interfaces:
Comparable<SemanticVersion>

public final class SemanticVersion extends Object implements Comparable<SemanticVersion>
Can be a normal version number like 6.8.2-9 i.e 9 is the build number Or can be for a feature like 6.1.6-specialFeature12-19 i.e. build number 19 of specialFeature12
  • Constructor Details

    • SemanticVersion

      public SemanticVersion(String value)
  • Method Details

    • of

      public static SemanticVersion of(String value)
      Parse a version string to produce a Semantic Version object. If un-parsable then an invalid semantic version will result.
    • withNoBuildNumber

      public static SemanticVersion withNoBuildNumber(String value)
      Parse a version string that also have a build number to produce a Semantic Version object. If un-parsable then an invalid semantic version will result.
    • major

      public int major()
    • incrementMajor

      public void incrementMajor()
      Just add one to the major part of the version. But resets minor, patch and build to zero.
    • minor

      public int minor()
    • incrementMinor

      public void incrementMinor()
      Just add one to the minor part of the version. But resets patch and build to zero.
    • patch

      public int patch()
    • incrementPatch

      public void incrementPatch()
      Just add one to the patch part of the version. But resets build to zero.
    • feature

      public String feature()
    • buildNumber

      public int buildNumber()
    • incrementBuildNumber

      public void incrementBuildNumber()
      Just add one to the build number part of the version.
    • compareTo

      public int compareTo(SemanticVersion ver)
      Specified by:
      compareTo in interface Comparable<SemanticVersion>
    • isValid

      public boolean isValid()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object