Annotate all the things

This commit is contained in:
FalsePattern committed 2022-08-06 13:12:55 +02:00
1 parent 980e8a8776
commit da1ef6c8c7
63 files changed
+623 -369

No files matched your search

@@ -29,14 +29,19 @@ import org.apache.logging.log4j.Logger;
@StableAPI(since = "0.8.0")
public class ModUpdateInfo {
@NonNull
@StableAPI.Expose
public final String modID;
@NonNull
@StableAPI.Expose
public final String currentVersion;
@NonNull
@StableAPI.Expose
public final String latestVersion;
@NonNull
@StableAPI.Expose
public final String updateURL;
@StableAPI.Expose
public void log(Logger logger) {
logger.info("Updates are available for mod {}: Currently installed version is {}, " +
"latest available version is {}. Update URL: {}", modID, currentVersion, latestVersion,
@@ -24,18 +24,22 @@ import com.falsepattern.lib.StableAPI;
@StableAPI(since = "0.8.3")
public class UpdateCheckException extends Exception {
@StableAPI.Expose
public UpdateCheckException(String message) {
super(message);
}
@StableAPI.Expose
public UpdateCheckException(String message, Throwable cause) {
super(message, cause);
}
@StableAPI.Expose
public UpdateCheckException(Throwable cause) {
super(cause);
}
@StableAPI.Expose
protected UpdateCheckException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
@@ -73,6 +73,7 @@ public class UpdateChecker {
*
* @return A list of mods that were both available on the URL and installed
*/
@StableAPI.Expose
public static CompletableFuture<List<ModUpdateInfo>> fetchUpdatesAsync(String url) {
return CompletableFuture.supplyAsync(() -> {
if (!LibraryConfig.ENABLE_UPDATE_CHECKER) {
@@ -168,6 +169,7 @@ public class UpdateChecker {
*
* @throws UpdateCheckException If the update checker is disabled in config, the URL is invalid, or
*/
@StableAPI.Expose
public static List<ModUpdateInfo> fetchUpdates(String url) throws UpdateCheckException {
try {
return fetchUpdatesAsync(url).join();
@@ -190,6 +192,7 @@ public class UpdateChecker {
*
* @return A list of chat messages that can be sent to players
*/
@StableAPI.Expose
public static List<IChatComponent> updateListToChatMessages(String initiator, List<ModUpdateInfo> updates) {
if (updates == null || updates.size() == 0) {
return null;