<commit_before>/*
 * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;

import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;

public final class YangValidationBundles {

    public static final HashSet<StatementDefinition> SUPPORTED_REFINE_SUBSTATEMENTS = new HashSet<>(
            Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.DEFAULT,
                    Rfc6020Mapping.DESCRIPTION, Rfc6020Mapping.REFERENCE,
                    Rfc6020Mapping.CONFIG, Rfc6020Mapping.MANDATORY,
                    Rfc6020Mapping.MUST, Rfc6020Mapping.PRESENCE,
                    Rfc6020Mapping.MIN_ELEMENTS, Rfc6020Mapping.MAX_ELEMENTS }));

    public static final HashMap<StatementDefinition, HashSet<StatementDefinition>> SUPPORTED_REFINE_TARGETS = new HashMap<>();
    static {
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.DEFAULT, new HashSet<>(
            Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE })));
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.MANDATORY, new HashSet<>(
                Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE, Rfc6020Mapping.ANYXML })));
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.PRESENCE, new HashSet<>(
                Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.CONTAINER })));
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.MUST, new HashSet<>(
                Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.CONTAINER,
                        Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
                        Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML, })));
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.MIN_ELEMENTS, new HashSet<>(
                Arrays.asList(new StatementDefinition[]{Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST})));
        SUPPORTED_REFINE_TARGETS.put(Rfc6020Mapping.MAX_ELEMENTS, new HashSet<>(
                Arrays.asList(new StatementDefinition[]{Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST})));
    }


    public static final HashSet<StatementDefinition> SUPPORTED_AUGMENT_TARGETS = new HashSet<>(
            Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.CONTAINER,
                    Rfc6020Mapping.LIST, Rfc6020Mapping.CASE,
                    Rfc6020Mapping.INPUT, Rfc6020Mapping.OUTPUT,
                    Rfc6020Mapping.NOTIFICATION, Rfc6020Mapping.CHOICE,
                    Rfc6020Mapping.RPC }));

    public static final HashSet<StatementDefinition> SUPPORTED_CASE_SHORTHANDS = new HashSet<>(
            Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.CONTAINER,
                    Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
                    Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML, }));

    public static final HashSet<StatementDefinition> SUPPORTED_DATA_NODES = new HashSet<>(
            Arrays.asList(new StatementDefinition[] { Rfc6020Mapping.CONTAINER,
                    Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
                    Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML, }));

    private YangValidationBundles() {
        throw new UnsupportedOperationException("Utility class");
    }
}<commit_msg>Use ImmutableSet/Map in YangValidationBundles<commit_after>/*
 * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.ImmutableSet;
import java.util.Map;
import java.util.Set;
import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;

public final class YangValidationBundles {
    private YangValidationBundles() {
        throw new UnsupportedOperationException("Utility class");
    }

    public static final Set<StatementDefinition> SUPPORTED_REFINE_SUBSTATEMENTS = ImmutableSet.<StatementDefinition>of(
        Rfc6020Mapping.DEFAULT, Rfc6020Mapping.DESCRIPTION, Rfc6020Mapping.REFERENCE, Rfc6020Mapping.CONFIG,
        Rfc6020Mapping.MANDATORY, Rfc6020Mapping.MUST, Rfc6020Mapping.PRESENCE, Rfc6020Mapping.MIN_ELEMENTS,
        Rfc6020Mapping.MAX_ELEMENTS);

    public static final Map<StatementDefinition, Set<StatementDefinition>> SUPPORTED_REFINE_TARGETS;
    static {
        final Builder<StatementDefinition, Set<StatementDefinition>> b = ImmutableMap.builder();
        b.put(Rfc6020Mapping.DEFAULT, ImmutableSet.<StatementDefinition>of(Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE));
        b.put(Rfc6020Mapping.MANDATORY, ImmutableSet.<StatementDefinition>of(
                Rfc6020Mapping.LEAF, Rfc6020Mapping.CHOICE, Rfc6020Mapping.ANYXML));
        b.put(Rfc6020Mapping.PRESENCE, ImmutableSet.<StatementDefinition>of(Rfc6020Mapping.CONTAINER));
        b.put(Rfc6020Mapping.MUST, ImmutableSet.<StatementDefinition>of(
                Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF,
                Rfc6020Mapping.LEAF_LIST, Rfc6020Mapping.ANYXML));
        b.put(Rfc6020Mapping.MIN_ELEMENTS, ImmutableSet.<StatementDefinition>of(
                Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
        b.put(Rfc6020Mapping.MAX_ELEMENTS, ImmutableSet.<StatementDefinition>of(
                Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF_LIST));
        SUPPORTED_REFINE_TARGETS = b.build();
    }


    public static final Set<StatementDefinition> SUPPORTED_AUGMENT_TARGETS = ImmutableSet.<StatementDefinition>of(
        Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.CASE, Rfc6020Mapping.INPUT, Rfc6020Mapping.OUTPUT,
        Rfc6020Mapping.NOTIFICATION, Rfc6020Mapping.CHOICE, Rfc6020Mapping.RPC);

    public static final Set<StatementDefinition> SUPPORTED_CASE_SHORTHANDS = ImmutableSet.<StatementDefinition>of(
        Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
        Rfc6020Mapping.ANYXML);

    public static final Set<StatementDefinition> SUPPORTED_DATA_NODES = ImmutableSet.<StatementDefinition>of(
        Rfc6020Mapping.CONTAINER, Rfc6020Mapping.LIST, Rfc6020Mapping.LEAF, Rfc6020Mapping.LEAF_LIST,
        Rfc6020Mapping.ANYXML);
}
{'fraction_non_alphanumeric': 0.08750180193167074, 'fraction_numerical': 0.05996828600259478, 'mean_word_length': 3.903180212014134, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1122617', 'n_tokens_mistral': 2411, 'n_tokens_neox': 2114, 'n_words': 334}