Class Config

java.lang.Object
be.panako.util.Config

public class Config extends Object
Writes and read the configuration values to and from a properties file.
  • Constructor Details

    • Config

      public Config()
      Hidden default constructor. Reads the configured values, or stores the defaults.
  • Method Details

    • writePreference

      public void writePreference(String preferenceKey, String value)
    • readPreference

      public String readPreference(String preferenceKey)
    • getInstance

      public static Config getInstance()
    • get

      public static String get(Key key)
    • getInt

      public static int getInt(Key key)
    • getFloat

      public static float getFloat(Key key)
    • getBoolean

      public static boolean getBoolean(Key key)
    • set

      public static void set(Key key, String value)
      Sets a configuration value to use during the runtime of the application. These configuration values are not persisted. To
      Parameters:
      key - The key to set.
      value - The value to use.
    • setPreference

      public static void setPreference(String key, String value)
      Use preferences to store configuration that changes during runtime and need to be persisted.
      Parameters:
      key - The key to store.
      value - The value to store
    • getPreference

      public static String getPreference(String key)
      Use preferences to store configuration that changes during runtime and need to be persisted.
      Parameters:
      key - The key to store.
      Returns:
      The configured preference value.