Package io.tesler.model.core.service
Class DictionaryCacheImpl
- java.lang.Object
-
- io.tesler.model.core.service.DictionaryCacheImpl
-
- All Implemented Interfaces:
DictionaryCache
@DependsOn("deploymentTransactionSupport") @Service public class DictionaryCacheImpl extends Object implements DictionaryCache
Initiator of the cache of simple dictionaries. The idea is simple, when you start the application and raise the context of the spring, we have a cache of simple directories, access to this cache and not to the base throughout the entire operation of the application. Key - the name of the dictionary (DICTIONARY_TYPE), value - the dictionary of a simple structure String - StringGeneral structure of a simple dictionary: KEY (LIC) - independent language key VALUE- value
-
-
Field Summary
-
Fields inherited from interface io.tesler.api.data.dictionary.DictionaryCache
instance
-
-
Constructor Summary
Constructors Constructor Description DictionaryCacheImpl(LocaleService localeService, Optional<List<DictionaryCacheLoader>> loaders)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(LOV key, IDictionaryType type)
boolean
containsKey(String key, IDictionaryType type)
boolean
containsValue(String value, IDictionaryType type)
SimpleDictionary
get(IDictionaryType type, String key)
SimpleDictionary
get(String type, String key)
Collection<SimpleDictionary>
getAll(IDictionaryType dictionaryType)
Collection<SimpleDictionary>
getAll(String dictionaryType)
String
getDescription(String key, IDictionaryType type)
LOV
lookupName(String val, IDictionaryType type)
Finding a key in the dictionary by valueLOV
lookupName(String val, String type)
String
lookupValue(LOV key, IDictionaryType type)
Finding dictionary values by keyString
lookupValue(LOV key, String type)
String
lookupValueNullable(LOV key, IDictionaryType type)
void
reload()
Set<String>
types()
-
-
-
Constructor Detail
-
DictionaryCacheImpl
public DictionaryCacheImpl(LocaleService localeService, Optional<List<DictionaryCacheLoader>> loaders)
-
-
Method Detail
-
reload
public void reload()
- Specified by:
reload
in interfaceDictionaryCache
-
get
public SimpleDictionary get(IDictionaryType type, String key)
- Specified by:
get
in interfaceDictionaryCache
- Parameters:
type
- dictionary typekey
- dictionary key- Returns:
- SimpleDictionary
-
get
public SimpleDictionary get(String type, String key)
- Specified by:
get
in interfaceDictionaryCache
-
getAll
public Collection<SimpleDictionary> getAll(IDictionaryType dictionaryType)
- Specified by:
getAll
in interfaceDictionaryCache
- Parameters:
dictionaryType
- dictionary type- Returns:
- SimpleDictionary
-
getAll
public Collection<SimpleDictionary> getAll(String dictionaryType)
- Specified by:
getAll
in interfaceDictionaryCache
-
lookupValue
public String lookupValue(LOV key, IDictionaryType type)
Finding dictionary values by key- Specified by:
lookupValue
in interfaceDictionaryCache
- Parameters:
key
- keytype
- dictionary type- Returns:
- Russian-language value of the dictionary
-
lookupValue
public String lookupValue(LOV key, String type)
- Specified by:
lookupValue
in interfaceDictionaryCache
-
lookupValueNullable
public String lookupValueNullable(LOV key, IDictionaryType type)
- Specified by:
lookupValueNullable
in interfaceDictionaryCache
-
lookupName
public LOV lookupName(String val, IDictionaryType type)
Finding a key in the dictionary by value- Specified by:
lookupName
in interfaceDictionaryCache
- Parameters:
val
- valuetype
- dictionary type- Returns:
- dictionary key
-
lookupName
public LOV lookupName(String val, String type)
- Specified by:
lookupName
in interfaceDictionaryCache
-
containsKey
public boolean containsKey(String key, IDictionaryType type)
- Specified by:
containsKey
in interfaceDictionaryCache
-
containsKey
public boolean containsKey(LOV key, IDictionaryType type)
- Specified by:
containsKey
in interfaceDictionaryCache
-
containsValue
public boolean containsValue(String value, IDictionaryType type)
- Specified by:
containsValue
in interfaceDictionaryCache
-
getDescription
public String getDescription(String key, IDictionaryType type)
- Specified by:
getDescription
in interfaceDictionaryCache
-
types
public Set<String> types()
- Specified by:
types
in interfaceDictionaryCache
-
-