com.googlecode.gwt.test.internal.patchers.DictionaryPatcher Maven / Gradle / Ivy
package com.googlecode.gwt.test.internal.patchers;
import com.google.gwt.i18n.client.Dictionary;
import com.googlecode.gwt.test.internal.i18n.DictionaryUtils;
import com.googlecode.gwt.test.patchers.PatchClass;
import com.googlecode.gwt.test.patchers.PatchMethod;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Map;
@PatchClass(Dictionary.class)
class DictionaryPatcher {
@PatchMethod
static void addKeys(Dictionary dictionary, HashSet s) {
Map entries = DictionaryUtils.getEntries(dictionary);
s.addAll(entries.keySet());
}
@PatchMethod
static void addValues(Dictionary dictionary, ArrayList s) {
Map entries = DictionaryUtils.getEntries(dictionary);
s.addAll(entries.values());
}
@PatchMethod
static void attach(Dictionary dictionary, String name) {
DictionaryUtils.attach(dictionary, name);
}
@PatchMethod
static String get(Dictionary dictionary, String key) {
Map entries = DictionaryUtils.getEntries(dictionary);
return entries.get(key);
}
}