Interface UpdateChecker


public interface UpdateChecker
  • Field Details

    • URL_RELEASE

      static final URI URL_RELEASE
    • URL_STAGING

      static final URI URL_STAGING
  • Method Details

    • isUpdateAvailable

      boolean isUpdateAvailable()
      Compares the current version and latest version (if available) to see if there is a new version available.
      Returns:
      True if new version is available, false otherwise (no new version available or version info unavailable).
    • getLatestVersion

      @Nullable @Nullable String getLatestVersion()
      Gets the latest release of uSkyBlock. Returns NULL if the version info hasn't been fetched yet or is unavailable.
      Returns:
      Latest release of uSkyBlock, NULL when unavailable.
    • getCurrentVersion

      @NotNull @NotNull String getCurrentVersion()
      Gets the current version of uSkyBlock running on the server.
      Returns:
      Current version of uSkyBlock.
    • fetchLatestVersion

      CompletableFuture<String> fetchLatestVersion(URI uri)
      Fetches the latest version info from the uSkyBlock website. Returns a , completes the HTTP request async. The CompletableFuture will contain NULL when version info cannot be obtained.
      Parameters:
      uri - URI to use for the HTTP request, official links are URL_RELEASE and URL_STAGING.
      Returns:
      CompletableFuture with the latest version info.
    • isNewerVersion

      boolean isNewerVersion(String currentVersion, String newVersion)
      Compares two version numbers. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
      Parameters:
      currentVersion - Current version number (may contain -SNAPSHOT).
      newVersion - New version number (may contain -SNAPSHOT).
      Returns:
      Negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.