public List<XmlDictionaryItemWrapper> getItems(final String dictionaryId, final String languageCode) {
return getDictionary(dictionaryId, languageCode).getItems();
}
public XmlDictionaryWrapper getDictionary(final String dictionaryId, final String languageCode) {
Dictionary dictionary = from(processDictionaries.getDictionaries()).where(new P<Dictionary>() {
@Override
public boolean invoke(Dictionary dictionary) {
return dictionary.getDictionaryId().equals(dictionaryId) && dictionary.getLanguageCode().equals(languageCode);
}
}).firstOrDefault();
if (dictionary == null) {
dictionary = new Dictionary();
dictionary.setDictionaryId(dictionaryId);
dictionary.setLanguageCode(languageCode);
processDictionaries.getDictionaries().add(dictionary);
}
return new XmlDictionaryWrapper(dictionary);
}