Package kr.toxicity.model.api.util
Class HttpUtil
java.lang.Object
kr.toxicity.model.api.util.HttpUtil
Http util
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceHttp client consumerstatic final recordLatest versionstatic final recordPlugin versionstatic interfacehttp result -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> @NotNull HttpUtil.Result<T> client(@NotNull HttpUtil.HttpClientConsumer<T> consumer) Uses http clientstatic @NotNull HttpUtil.LatestVersionlatestOf(@NotNull List<HttpUtil.PluginVersion> versions) Gets the latest version from a version liststatic @NotNull HttpUtil.LatestVersionSearches BetterModel's latest versionstatic @NotNull HttpUtil.LatestVersionversionList(@NotNull MinecraftVersion version) Searches BetterModel's latest version compatible with current server
-
Method Details
-
versionList
Searches BetterModel's latest version- Returns:
- latest version
-
versionList
@NotNull public static @NotNull HttpUtil.LatestVersion versionList(@NotNull @NotNull MinecraftVersion version) Searches BetterModel's latest version compatible with current server- Parameters:
version- server version- Returns:
- latest version
-
latestOf
@NotNull public static @NotNull HttpUtil.LatestVersion latestOf(@NotNull @NotNull List<HttpUtil.PluginVersion> versions) Gets the latest version from a version list- Parameters:
versions- versions- Returns:
- latest version
-
client
@NotNull public static <T> @NotNull HttpUtil.Result<T> client(@NotNull @NotNull HttpUtil.HttpClientConsumer<T> consumer) Uses http client- Type Parameters:
T- type- Parameters:
consumer- consumer- Returns:
- result
-