Package org.bgerp.app.cfg

# Class Preferences

java.lang.Object
java.util.AbstractMap<String,String>
org.bgerp.app.cfg.ConfigMap
org.bgerp.app.cfg.Preferences

All Implemented Interfaces:
  `Map<String,String>`

Direct Known Subclasses:
  `Setup`

public class Preferences extends ConfigMap
`ConcurrentHashMap` based implementation of `ConfigMap`.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.util.AbstractMap

  `AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>`

  ## Nested classes/interfaces inherited from interface java.util.Map

  `Map.Entry<K,V>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final ConcurrentHashMap<String,String>`
  `data`

  ### Fields inherited from class org.bgerp.app.cfg.ConfigMap

  `EMPTY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Preferences()`
  `Preferences(String data)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Set<Map.Entry<String,String>>`
  `entrySet()`
  `String`
  `get(String key, String def)`
  `Map<String,String>`
  `getDataMap()`
  `protected void`
  `loadBundle(String bundleName, Map<String,String> data, boolean validate)`
  Loads configuration file to map.
  `static ConfigMap`
  `processIncludes(ConfigDAO configDao, String config, boolean validate)`
  Inserts includes placed with
  `String`
  `put(String key, String value)`
  `void`
  `putAll(Map<? extends String,? extends String> m)`
  `void`
  `removeSub(String prefix)`

  ### Methods inherited from class org.bgerp.app.cfg.ConfigMap

  `clearConfigs, get, getBigDecimal, getBoolean, getBoolean, getConfig, getConfig, getDataString, getInt, getInt, getLong, getLong, getSok, getSok, getSokBoolean, getSokBoolean, getSokLong, getSokLong, removeConfig, sub, subIndexed, subKeyed, subSok, subSokIndexed, validateConfig`

  ### Methods inherited from class java.util.AbstractMap

  `clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, remove, size, toString, values`

  ### Methods inherited from class java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.util.Map

  `compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll`

- ## Field Details

  - ### data

    protected final ConcurrentHashMap<String,String> data

- ## Constructor Details

  - ### Preferences

    public Preferences()

  - ### Preferences

    public Preferences(String data)

- ## Method Details

  - ### get

    public String get(String key, String def)
    Specified by:
      `get` in class `ConfigMap`

  - ### entrySet

    public Set<Map.Entry<String,String>> entrySet()
    Specified by:
      `entrySet` in interface `Map<String,String>`
    Specified by:
      `entrySet` in class `ConfigMap`

  - ### put

    public String put(String key, String value)
    Specified by:
      `put` in interface `Map<String,String>`
    Overrides:
      `put` in class `AbstractMap<String,String>`

  - ### putAll

    public void putAll(Map<? extends String,? extends String> m)
    Specified by:
      `putAll` in interface `Map<String,String>`
    Overrides:
      `putAll` in class `AbstractMap<String,String>`

  - ### getDataMap

    public Map<String,String> getDataMap()

  - ### removeSub

    public void removeSub(String prefix)

  - ### loadBundle

    protected void loadBundle(String bundleName, Map<String,String> data, boolean validate)
    Loads configuration file to map.
    Parameters:
      `bundleName` - file name without '.properties' extension.
      `data` - target map.
      `validate` - check used in values variables.

  - ### processIncludes

    public static ConfigMap processIncludes(ConfigDAO configDao, String config, boolean validate) throws BGMessageException, SQLException
    Inserts includes placed with

        include.ID=1

    expressions.
    Parameters:
      `configDao` - DAO for getting includes.
      `config` - key-value lines of main configuration.
      `validate` - check existence of includes configurations, variables.
    Throws:
      `BGMessageException`
      `SQLException`