Class AdvancedServerListAPI
java.lang.Object
ch.andre601.advancedserverlist.api.AdvancedServerListAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddPlaceholderProvider(@NonNull PlaceholderProvider placeholderProvider) Adds the providedPlaceholderProviderto the list, if it passes the following checks:static @NonNull AdvancedServerListAPIget()Retrieves the instance used of this API.@Nullable PlaceholderProviderretrievePlaceholderProvider(@NonNull String identifier) Retrieves thePlaceholderProviderassociated with the given identifier, ornullshould no such entry exist.
-
Method Details
-
get
Retrieves the instance used of this API.
If no instance has been made so far will a new one be created.- Returns:
- Instance of this API.
-
addPlaceholderProvider
Adds the provided
PlaceholderProviderto the list, if it passes the following checks:- Provided PlaceholderProvider is not
null. - The identifier is not
nullor empty. - The identifier does not contain any spaces.
- A PlaceholderProvider with the same identifier doesn't exist already.
Not passing any of the above checks results in a InvalidPlaceholderProviderException being thrown.
- Parameters:
placeholderProvider- ThePlaceholderProviderto add.- Throws:
InvalidPlaceholderProviderException- When the provided PlaceholderProvider instance has anullor empty identifier, the identifier contains spaces or another provider with the same identifier is already loaded.
- Provided PlaceholderProvider is not
-
retrievePlaceholderProvider
Retrieves thePlaceholderProviderassociated with the given identifier, ornullshould no such entry exist.- Parameters:
identifier- The identifier to find a matchingPlaceholderProviderfor.- Returns:
- Possibly-null PlaceholderProvider instance.
-