Class Semver

java.lang.Object
com.sap.cds.maven.plugin.util.Semver

public class Semver extends Object
This class represents a semantic version information. For further details see Semantic Versioning.
  • Constructor Details

    • Semver

      public Semver(String version)
      Constructs a new Semver instance with given version string.
      Parameters:
      version - a version string in a valid semver pattern, e.g. "1.2.4"
      Throws:
      IllegalArgumentException - if the given version is not a valid Semantic Version with at least major, minor and patch information.
  • Method Details

    • compareTo

      public int compareTo(Semver another)
      Compares this Semver instance with another
      Parameters:
      another - the other Semver instance to compare to
      Returns:
      0 if both are equal, 1 if this instance is greater, otherwise -1.
    • toString

      public String toString()
      Overrides:
      toString in class Object