Package revxrsal.commands.locales
Interface LocaleReader
public interface LocaleReader
A locale reader is a source in which messages for a specific locale
are fetched. This can be a file, a resource bundle, or even a remote
source.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
containsKey
(String key) Returns whether this reader contains a mapping for the given key.Returns the mapping value for this key.Returns the locale of by this readerstatic @NotNull LocaleReader
wrap
(@NotNull ResourceBundle bundle) Wraps aResourceBundle
in aLocaleReader
.
-
Method Details
-
containsKey
Returns whether this reader contains a mapping for the given key.- Parameters:
key
- Key to check for- Returns:
true
if this reader has a mapping for the key
-
get
Returns the mapping value for this key. It is recommended that this only return values ifcontainsKey(String)
is true, otherwise throwing an exception to avoid confusion.- Parameters:
key
- Key to fetch for- Returns:
- The string value
-
getLocale
Locale getLocale()Returns the locale of by this reader- Returns:
- The reader's locale
-
wrap
Wraps aResourceBundle
in aLocaleReader
.- Parameters:
bundle
- Bundle to wrap- Returns:
- The locale reader
-