All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.googlecode.gwt.test.internal.patchers.DictionaryPatcher Maven / Gradle / Ivy

There is a newer version: 0.63
Show newest version
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);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy