<commit_before>package com.dtolabs.rundeck.core.dispatcher;

/**
 * Created by greg on 5/26/16.
 */
public interface MutableDataContext extends DataContext, Mergable<DataContext> {
    void merge(DataContext item);
}<commit_msg>Add utility methods for interface<commit_after>package com.dtolabs.rundeck.core.dispatcher;

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

/**
 * Created by greg on 5/26/16.
 */
public interface MutableDataContext extends DataContext, Mergable<DataContext> {
    void merge(DataContext item);

    /**
     * Put value
     *
     * @param group
     * @param key
     * @param value
     *
     * @return
     */
    public default String put(String group, String key, String value) {
        return group(group).put(key, value);
    }

    default Map<String, String> group(final String group) {
        if (null == get(group)) {
            put(group, new HashMap<>());
        }
        return get(group);
    }
}
{'fraction_non_alphanumeric': 0.11708860759493671, 'fraction_numerical': 0.010548523206751054, 'mean_word_length': 2.8577235772357725, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7153528', 'n_tokens_mistral': 297, 'n_tokens_neox': 286, 'n_words': 75}