Class BetterStatsRestAPI
java.lang.Object
com.thecsdev.betterstats.resource.dto.BetterStatsRestAPI
This class represents TheCSDev's REST-ful APIs specifically designed for this mod.
The API provides various endpoints that allow the mod to fetch and interact with
additional features and data beyond the standard statistics screen functionality.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classProvides telemetry information used by the REST-ful API. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanstatic final CompletableFuture<BetterStatsRestAPI> Fetches the REST API data from the endpoint specified in this mod's configuration.static final CompletableFuture<BetterStatsRestAPI> fetchAsync(@NotNull URI apiEndpoint) Fetches the REST API data from the specified endpoint.static final CompletableFuture<List<CreditsSection>> Fetches the built-in "Credits" data from the classpath resource.final CompletableFuture<List<CreditsSection>> Fetches the "Credits" data from this RESTful API.static final CompletableFuture<List<CreditsSection>> fetchCreditsAsync(@NotNull URI creditsUri) Fetches the "Credits" data from the specifiedURI.final CompletableFuture<List<CreditsSection>> Fetches the "News" data from this RESTful API.final @NotNull URIReturns theURIof the "Credits" endpoint in this RESTful API.final @NotNull URIReturns theURIof the RESTful API endpoint used to fetch thisBetterStatsRestAPI.final @NotNull URIReturns theURIof the "News" endpoint in this RESTful API.final inthashCode()
-
Method Details
-
hashCode
-
equals
-
getEndpointURI
Returns theURIof the RESTful API endpoint used to fetch thisBetterStatsRestAPI. -
getCreditsURI
-
getNewsURI
-
fetchCreditsAsync
Fetches the "Credits" data from this RESTful API.- Returns:
- A
CompletableFuturethat will complete with the fetchedCreditsSectioninstances.
-
fetchNewsAsync
Fetches the "News" data from this RESTful API.- Returns:
- A
CompletableFuturethat will complete with the fetchedCreditsSectionCreditsSectioninstances.
-
fetchBuiltInCreditsAsync
Fetches the built-in "Credits" data from the classpath resource.- Returns:
- A
CompletableFuturethat will complete with the fetchedCreditsSectioninstances.
-
fetchCreditsAsync
public static final CompletableFuture<List<CreditsSection>> fetchCreditsAsync(@NotNull @NotNull URI creditsUri) Fetches the "Credits" data from the specifiedURI.- Parameters:
creditsUri- TheURIto fetch the "Credits" data from.- Returns:
- A
CompletableFuturethat will complete with the fetchedCreditsSectioninstances. - Throws:
NullPointerException- If the argument isnull.
-
fetchAsync
Fetches the REST API data from the endpoint specified in this mod's configuration.- Returns:
- A
CompletableFuturethat will complete with the fetchedBetterStatsRestAPIinstance.
-
fetchAsync
@Internal public static final CompletableFuture<BetterStatsRestAPI> fetchAsync(@NotNull @NotNull URI apiEndpoint) throws NullPointerException Fetches the REST API data from the specified endpoint.- Parameters:
apiEndpoint- The endpointURIto fetch the REST API data from.- Returns:
- A
CompletableFuturethat will complete with the fetchedBetterStatsRestAPIinstance. - Throws:
NullPointerException- If the argument isnull.
-