Package wtf.choco.veinminer.update
Class UpdateResult
java.lang.Object
wtf.choco.veinminer.update.UpdateResult
Represents a result of an update check from the
UpdateChecker
.-
Constructor Summary
ConstructorDescriptionUpdateResult
(@NotNull String currentVersion, @NotNull String newestVersion, @NotNull VersionScheme versionScheme, boolean updateAvailable) Construct a newUpdateResult
.UpdateResult
(@NotNull String currentVersion, @NotNull VersionScheme versionScheme, @NotNull Throwable exception) Construct a newUpdateResult
. -
Method Summary
Modifier and TypeMethodDescription@NotNull String
Get the currently installed version of the plugin.Get theThrowable
that was thrown during the update check, if one is present.@NotNull String
Get the newest available version of the plugin.@NotNull VersionScheme
Get theVersionScheme
used in the update check.boolean
isFailed()
Check whether or not this update check failed and there was an exception.boolean
Check whether or not there is an update available for download.
-
Constructor Details
-
UpdateResult
public UpdateResult(@NotNull @NotNull String currentVersion, @NotNull @NotNull String newestVersion, @NotNull @NotNull VersionScheme versionScheme, boolean updateAvailable) Construct a newUpdateResult
.- Parameters:
currentVersion
- the currently installed version of the pluginnewestVersion
- the newest version of the plugin (may or may not equalcurrentVersion
)versionScheme
- the version scheme used in the update checkupdateAvailable
- 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 newUpdateResult
.- Parameters:
currentVersion
- the currently installed version of the pluginversionScheme
- the version scheme used in the update checkexception
- the exception that was thrown in the update check
-
-
Method Details
-
getCurrentVersion
Get the currently installed version of the plugin.- Returns:
- the current version
-
getNewestVersion
Get the newest available version of the plugin. May or may not equalgetCurrentVersion()
.- Returns:
- the newest version
-
getVersionScheme
Get theVersionScheme
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
Get theThrowable
that was thrown during the update check, if one is present.- Returns:
- the exception thrown
-