Class VersionComparator

java.lang.Object
org.inventivetalent.update.spiget.comparator.VersionComparator

public abstract class VersionComparator extends Object
  • Field Details

    • EQUAL

      public static final VersionComparator EQUAL
      Compares versions by checking if the version strings are equal
    • SEM_VER

      public static final VersionComparator SEM_VER
      Compares versions by their Sematic Version (Major.Minor.Patch, semver.org). Removes dots and compares the resulting Integer values
    • SEM_VER_SNAPSHOT

      public static final VersionComparator SEM_VER_SNAPSHOT
      Same as SEM_VER, but supports version names with '-SNAPSHOT' suffixes
  • Constructor Details

    • VersionComparator

      public VersionComparator()
  • Method Details

    • isNewer

      public abstract boolean isNewer(String currentVersion, String checkVersion)
      Called to check if a version is newer
      Parameters:
      currentVersion - Current version of the plugin
      checkVersion - Version to check
      Returns:
      true if the checked version is newer