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 Details

    • containsKey

      boolean containsKey(String key)
      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

      String get(String key)
      Returns the mapping value for this key. It is recommended that this only return values if containsKey(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

      @NotNull static @NotNull LocaleReader wrap(@NotNull @NotNull ResourceBundle bundle)
      Parameters:
      bundle - Bundle to wrap
      Returns:
      The locale reader