Class ConfigLocaleReader

java.lang.Object
dev.demeng.pluginbase.locale.reader.ConfigLocaleReader
All Implemented Interfaces:
LocaleReader

public class ConfigLocaleReader extends Object implements LocaleReader
A locale reader that uses Bukkit config files (such as .yml) instead of standard resource bundles (.properties). This should typically only be used if you want to have a singular locale file, such as a "messages.yml".
See Also:
  • Constructor Details

    • ConfigLocaleReader

      public ConfigLocaleReader()
  • Method Details

    • containsKey

      public boolean containsKey(@NotNull @NotNull String key)
      Description copied from interface: LocaleReader
      Returns whether this reader contains a mapping for the given key.
      Specified by:
      containsKey in interface LocaleReader
      Parameters:
      key - Key to check for
      Returns:
      true if this reader has a mapping for the key
    • get

      public String get(@NotNull @NotNull String key)
      Description copied from interface: LocaleReader
      Returns the mapping value for this key. It is recommended that this only return values if LocaleReader.containsKey(String) is true, otherwise throwing an exception to avoid confusion.
      Specified by:
      get in interface LocaleReader
      Parameters:
      key - Key to fetch for
      Returns:
      The string value
    • getArray

      public String[] getArray(@NotNull @NotNull String key)
      Description copied from interface: LocaleReader
      Returns the mapping value for this key. It is recommended that this only return values if LocaleReader.containsKey(String) is true, otherwise throwing an exception to avoid confusion.
      Specified by:
      getArray in interface LocaleReader
      Parameters:
      key - Key to fetch for
      Returns:
      The string array value