Package org.cxbox.model.core.service
Class DictionaryCacheImpl
- java.lang.Object
-
- org.cxbox.model.core.service.DictionaryCacheImpl
-
- All Implemented Interfaces:
DictionaryCache
@DependsOn("deploymentTransactionSupport") @Service public class DictionaryCacheImpl extends Object implements DictionaryCacheInitiator 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 org.cxbox.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 booleancontainsKey(String key, IDictionaryType type)booleancontainsKey(LOV key, IDictionaryType type)booleancontainsValue(String value, IDictionaryType type)SimpleDictionaryget(String type, String key)SimpleDictionaryget(IDictionaryType type, String key)Collection<SimpleDictionary>getAll(String dictionaryType)Collection<SimpleDictionary>getAll(IDictionaryType dictionaryType)StringgetDescription(String key, IDictionaryType type)LOVlookupName(String val, String type)LOVlookupName(String val, IDictionaryType type)Finding a key in the dictionary by valueStringlookupValue(LOV key, String type)StringlookupValue(LOV key, IDictionaryType type)Finding dictionary values by keyStringlookupValueNullable(LOV key, IDictionaryType type)voidreload()Set<String>types()
-
-
-
Constructor Detail
-
DictionaryCacheImpl
public DictionaryCacheImpl(LocaleService localeService, Optional<List<DictionaryCacheLoader>> loaders)
-
-
Method Detail
-
reload
public void reload()
- Specified by:
reloadin interfaceDictionaryCache
-
get
public SimpleDictionary get(IDictionaryType type, String key)
- Specified by:
getin interfaceDictionaryCache- Parameters:
type- dictionary typekey- dictionary key- Returns:
- SimpleDictionary
-
get
public SimpleDictionary get(String type, String key)
- Specified by:
getin interfaceDictionaryCache
-
getAll
public Collection<SimpleDictionary> getAll(IDictionaryType dictionaryType)
- Specified by:
getAllin interfaceDictionaryCache- Parameters:
dictionaryType- dictionary type- Returns:
- SimpleDictionary
-
getAll
public Collection<SimpleDictionary> getAll(String dictionaryType)
- Specified by:
getAllin interfaceDictionaryCache
-
lookupValue
public String lookupValue(LOV key, IDictionaryType type)
Finding dictionary values by key- Specified by:
lookupValuein interfaceDictionaryCache- Parameters:
key- keytype- dictionary type- Returns:
- Russian-language value of the dictionary
-
lookupValue
public String lookupValue(LOV key, String type)
- Specified by:
lookupValuein interfaceDictionaryCache
-
lookupValueNullable
public String lookupValueNullable(LOV key, IDictionaryType type)
- Specified by:
lookupValueNullablein interfaceDictionaryCache
-
lookupName
public LOV lookupName(String val, IDictionaryType type)
Finding a key in the dictionary by value- Specified by:
lookupNamein interfaceDictionaryCache- Parameters:
val- valuetype- dictionary type- Returns:
- dictionary key
-
lookupName
public LOV lookupName(String val, String type)
- Specified by:
lookupNamein interfaceDictionaryCache
-
containsKey
public boolean containsKey(String key, IDictionaryType type)
- Specified by:
containsKeyin interfaceDictionaryCache
-
containsKey
public boolean containsKey(LOV key, IDictionaryType type)
- Specified by:
containsKeyin interfaceDictionaryCache
-
containsValue
public boolean containsValue(String value, IDictionaryType type)
- Specified by:
containsValuein interfaceDictionaryCache
-
getDescription
public String getDescription(String key, IDictionaryType type)
- Specified by:
getDescriptionin interfaceDictionaryCache
-
types
public Set<String> types()
- Specified by:
typesin interfaceDictionaryCache
-
-