Class SemanticVersion

java.lang.Object
io.micronaut.core.version.SemanticVersion
All Implemented Interfaces:
Comparable<SemanticVersion>

public class SemanticVersion extends Object implements Comparable<SemanticVersion>
Utility class for comparing semantic versions.
Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • SemanticVersion

      public SemanticVersion(String version)
      Constructor.
      Parameters:
      version - version
  • Method Details

    • getVersion

      public String getVersion()
      Returns:
      The version string
    • compareTo

      public int compareTo(SemanticVersion o)
      Specified by:
      compareTo in interface Comparable<SemanticVersion>
    • isAtLeastMajorMinor

      public static boolean isAtLeastMajorMinor(String version, int majorVersion, int minorVersion)
      Check whether the current version is at least the given major and minor version.
      Parameters:
      version - The version to check
      majorVersion - The major version
      minorVersion - The minor version
      Returns:
      True if it is
    • isAtLeast

      public static boolean isAtLeast(String version, String requiredVersion)
      Check whether the version is at least the given version.
      Parameters:
      version - The version
      requiredVersion - The required version
      Returns:
      True if it is