Interface UpdateChecker
public interface UpdateChecker
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionfetchLatestVersion
(URI uri) Fetches the latest version info from the uSkyBlock website.@NotNull String
Gets the current version of uSkyBlock running on the server.@Nullable String
Gets the latest release of uSkyBlock.boolean
isNewerVersion
(String currentVersion, String newVersion) Compares two version numbers.boolean
Compares the current version and latest version (if available) to see if there is a new version available.
-
Field Details
-
URL_RELEASE
-
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
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
Gets the current version of uSkyBlock running on the server.- Returns:
- Current version of uSkyBlock.
-
fetchLatestVersion
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 areURL_RELEASE
andURL_STAGING
.- Returns:
- CompletableFuture with the latest version info.
-
isNewerVersion
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.
-