Class AdvancedServerListAPI
java.lang.Object
ch.andre601.advancedserverlist.api.AdvancedServerListAPI
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPlaceholderProvider
(PlaceholderProvider placeholderProvider) Adds the providedPlaceholderProvider
to the list, if it passes the following checks:static AdvancedServerListAPI
get()
Retrieves the instance used of this API.retrievePlaceholderProvider
(String identifier) Retrieves thePlaceholderProvider
associated with the given identifier, ornull
should 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
PlaceholderProvider
to the list, if it passes the following checks:- Provided PlaceholderProvider is not
null
. - The identifier is not
null
or 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
- ThePlaceholderProvider
to add.- Throws:
InvalidPlaceholderProviderException
- When the provided PlaceholderProvider instance has anull
or empty identifier, the identifier contains spaces or another provider with the same identifier is already loaded.
- Provided PlaceholderProvider is not
-
retrievePlaceholderProvider
Retrieves thePlaceholderProvider
associated with the given identifier, ornull
should no such entry exist.- Parameters:
identifier
- The identifier to find a matchingPlaceholderProvider
for.- Returns:
- Possibly-null PlaceholderProvider instance.
-