Interface VersionComparator


public interface VersionComparator
Compares plugin version strings, so the update check can tell a newer release from an older one.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    isOlderThan(String first, String second)
    Whether one version predates another.
    boolean
    isOlderThan(String first, String second, boolean checkSnapshot)
    Whether one version predates another, optionally treating a snapshot as older than the release it leads to.
    boolean
    isSnapshot(String version)
    Whether a version is a snapshot rather than a release.
  • Method Details

    • isSnapshot

      boolean isSnapshot(String version)
      Whether a version is a snapshot rather than a release.
      Parameters:
      version - the version
      Returns:
      true if it is a snapshot
    • isOlderThan

      boolean isOlderThan(String first, String second)
      Whether one version predates another.
      Parameters:
      first - the version to test
      second - the version to compare against
      Returns:
      true if the first is older
    • isOlderThan

      boolean isOlderThan(String first, String second, boolean checkSnapshot)
      Whether one version predates another, optionally treating a snapshot as older than the release it leads to.
      Parameters:
      first - the version to test
      second - the version to compare against
      checkSnapshot - whether the snapshot marker is taken into account
      Returns:
      true if the first is older