net.alloyggp.tournament.impl.YamlUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ggp-tournament Show documentation
Show all versions of ggp-tournament Show documentation
A library for GGP tournament specification and scheduling.
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);
}
}
}