public void addItem(XmlDictionaryItemWrapper item) {
dictionary.getEntries().add(item.getWrappedObject());
}
public XmlDictionaryItemWrapper lookup(final String key) {
DictionaryEntry dictionaryEntry = from(dictionary.getEntries()).firstOrDefault(new P<DictionaryEntry>() {
@Override
public boolean invoke(DictionaryEntry dictionaryEntry) {
return dictionaryEntry.getKey().equals(key);
}
});
return dictionaryEntry != null ? new XmlDictionaryItemWrapper(dictionaryEntry) : null;
}