<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.protocol.bgp.openconfig.impl.comparator;

import com.google.common.collect.ImmutableMap;
import org.opendaylight.protocol.bgp.openconfig.impl.spi.OpenConfigComparator;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbors.Neighbor;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.Bgp;
import org.opendaylight.yangtools.yang.binding.DataObject;

public final class OpenConfigComparatorFactory {

    private static final ImmutableMap<Class<?>, OpenConfigComparator<? extends DataObject>> COMPARATORS = ImmutableMap.<Class<?>, OpenConfigComparator<? extends DataObject>>builder()
            .put(Bgp.class, new GlobalComparator())
            .put(Neighbor.class, new NeighborComparator())
            .build();

    public static <T extends DataObject> OpenConfigComparator<T> getComparator(final Class<T> clazz) {
        return (OpenConfigComparator<T>) COMPARATORS.get(clazz);
    }

}<commit_msg>Add a private constructor to hide the implicit public one<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.protocol.bgp.openconfig.impl.comparator;

import com.google.common.collect.ImmutableMap;
import org.opendaylight.protocol.bgp.openconfig.impl.spi.OpenConfigComparator;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.neighbors.Neighbor;
import org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.Bgp;
import org.opendaylight.yangtools.yang.binding.DataObject;

public final class OpenConfigComparatorFactory {
    private OpenConfigComparatorFactory() {
        throw new UnsupportedOperationException();
    }

    private static final ImmutableMap<Class<?>, OpenConfigComparator<? extends DataObject>> COMPARATORS = ImmutableMap.<Class<?>, OpenConfigComparator<? extends DataObject>>builder()
            .put(Bgp.class, new GlobalComparator())
            .put(Neighbor.class, new NeighborComparator())
            .build();

    public static <T extends DataObject> OpenConfigComparator<T> getComparator(final Class<T> clazz) {
        return (OpenConfigComparator<T>) COMPARATORS.get(clazz);
    }

}
{'fraction_non_alphanumeric': 0.10528206970894718, 'fraction_numerical': 0.015810276679841896, 'mean_word_length': 4.5568862275449105, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '383086', 'n_tokens_mistral': 861, 'n_tokens_neox': 834, 'n_words': 186}