<commit_before>package io.github.shadowchild.common.reg;


import java.util.HashMap;
import java.util.Map;

/**
 * Created by <NAME> on 16/01/2016.
 */
public class NamedRegistry<T> {

    public Map<String, T> registry = new HashMap<>();

    public int register(String name, T object) {

        if(registry.containsKey(name)) {

            return KEY_REGISTERED;
        } else if(registry.containsValue(object)) {

            return VALUE_REGISTERED;
        } else {

            registry.put(name, object);
            return SUCCESS;
        }
    }

    public static final int SUCCESS = 0, KEY_REGISTERED = 1, VALUE_REGISTERED = 2;
}<commit_msg>Added a get method to the NamedRegistry<commit_after>package io.github.shadowchild.common.reg;


import java.util.HashMap;
import java.util.Map;

/**
 * Created by <NAME> on 16/01/2016.
 */
public class NamedRegistry<T> {

    public Map<String, T> registry = new HashMap<>();

    public int register(String name, T object) {

        if(registry.containsKey(name)) {

            return KEY_REGISTERED;
        } else if(registry.containsValue(object)) {

            return VALUE_REGISTERED;
        } else {

            registry.put(name, object);
            return SUCCESS;
        }
    }

    public T getObject(String name) {

        if(registry.containsKey(name)) {

            return registry.get(name);
        }
        return null;
    }

    public static final int SUCCESS = 0, KEY_REGISTERED = 1, VALUE_REGISTERED = 2;
}
{'fraction_non_alphanumeric': 0.10828877005347594, 'fraction_numerical': 0.014705882352941176, 'mean_word_length': 2.364044943820225, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6650206', 'n_tokens_mistral': 479, 'n_tokens_neox': 442, 'n_words': 111}