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

net.alloyggp.tournament.internal.YamlUtils Maven / Gradle / Ivy

package net.alloyggp.tournament.internal;

import java.util.Map;
import java.util.Set;

import com.google.common.collect.Sets;
import com.google.common.collect.Sets.SetView;

public class YamlUtils {
    private YamlUtils() {
        //Not instantiable
    }

    public static void validateKeys(Map map, String specType, Set allowedKeys) {
        SetView unrecognizedKeys = Sets.difference(map.keySet(), allowedKeys);
        if (!unrecognizedKeys.isEmpty()) {
            throw new RuntimeException("Did not recognize keys in the " + specType + " configuration: "
                    + unrecognizedKeys);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy