Class UpdateResult

java.lang.Object
wtf.choco.veinminer.update.UpdateResult

public final class UpdateResult extends Object
Represents a result of an update check from the UpdateChecker.
  • Constructor Details

    • UpdateResult

      public UpdateResult(@NotNull @NotNull String currentVersion, @NotNull @NotNull String newestVersion, @NotNull @NotNull VersionScheme versionScheme, boolean updateAvailable)
      Construct a new UpdateResult.
      Parameters:
      currentVersion - the currently installed version of the plugin
      newestVersion - the newest version of the plugin (may or may not equal currentVersion)
      versionScheme - the version scheme used in the update check
      updateAvailable - whether or not an update is available for download
    • UpdateResult

      public UpdateResult(@NotNull @NotNull String currentVersion, @NotNull @NotNull VersionScheme versionScheme, @NotNull @NotNull Throwable exception)
      Construct a new UpdateResult.
      Parameters:
      currentVersion - the currently installed version of the plugin
      versionScheme - the version scheme used in the update check
      exception - the exception that was thrown in the update check
  • Method Details

    • getCurrentVersion

      @NotNull public @NotNull String getCurrentVersion()
      Get the currently installed version of the plugin.
      Returns:
      the current version
    • getNewestVersion

      @NotNull public @NotNull String getNewestVersion()
      Get the newest available version of the plugin. May or may not equal getCurrentVersion().
      Returns:
      the newest version
    • getVersionScheme

      @NotNull public @NotNull VersionScheme getVersionScheme()
      Get the VersionScheme used in the update check.
      Returns:
      the version scheme
    • isUpdateAvailable

      public boolean isUpdateAvailable()
      Check whether or not there is an update available for download.
      Returns:
      true if an update is available, false if on the latest version
    • isFailed

      public boolean isFailed()
      Check whether or not this update check failed and there was an exception.
      Returns:
      true if the check failed, false if it completed normally
    • getException

      @NotNull public @NotNull Optional<Throwable> getException()
      Get the Throwable that was thrown during the update check, if one is present.
      Returns:
      the exception thrown