Class DummyCaptionMap
java.lang.Object
com.plotsquared.core.configuration.caption.DummyCaptionMap
- All Implemented Interfaces:
CaptionMap
CaptionMap
implementation that throws exception on all getters-
Nested Class Summary
Nested classes/interfaces inherited from interface com.plotsquared.core.configuration.caption.CaptionMap
CaptionMap.NoSuchCaptionException
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a copy of the set of captions stored in the CaptionMapGet the locale of the messages stored in the mapgetMessage
(@NonNull TranslatableCaption caption) Get a message using the server localegetMessage
(@NonNull TranslatableCaption caption, @NonNull LocaleHolder localeHolder) Get a message using a specific localeboolean
supportsLocale
(@NonNull Locale locale) Check if the map supports a given locale
-
Constructor Details
-
DummyCaptionMap
public DummyCaptionMap()
-
-
Method Details
-
getMessage
public @NonNull String getMessage(@NonNull TranslatableCaption caption) throws CaptionMap.NoSuchCaptionException Description copied from interface:CaptionMap
Get a message using the server locale- Specified by:
getMessage
in interfaceCaptionMap
- Parameters:
caption
- Caption containing the caption key- Returns:
- Component
- Throws:
CaptionMap.NoSuchCaptionException
- if no caption with the given key exists
-
getMessage
public @NonNull String getMessage(@NonNull TranslatableCaption caption, @NonNull LocaleHolder localeHolder) throws CaptionMap.NoSuchCaptionException Description copied from interface:CaptionMap
Get a message using a specific locale- Specified by:
getMessage
in interfaceCaptionMap
- Parameters:
caption
- Caption containing the caption keylocaleHolder
- Holder that determines the message locale- Returns:
- Component
- Throws:
CaptionMap.NoSuchCaptionException
- if no caption with the given key exists
-
supportsLocale
Description copied from interface:CaptionMap
Check if the map supports a given locale- Specified by:
supportsLocale
in interfaceCaptionMap
- Parameters:
locale
- Locale- Returns:
true
if the map supports the locale
-
getLocale
Description copied from interface:CaptionMap
Get the locale of the messages stored in the map- Specified by:
getLocale
in interfaceCaptionMap
- Returns:
- Message locale
-
getCaptions
Description copied from interface:CaptionMap
Gets a copy of the set of captions stored in the CaptionMap- Specified by:
getCaptions
in interfaceCaptionMap
- Returns:
- An immutable set of TranslatableCaption
-