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

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

There is a newer version: 0.1.0
Show newest version
package net.alloyggp.tournament.impl;

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