private void verifyEnum(String id, String val) {
        EnumDef def = enumDefs.get(id);
        if (def == null)
            throw new IllegalArgumentException("No such enum in " + verifyWarning(id));
        if ( ! def.getVals().contains(val))
            throw new IllegalArgumentException("Invalid enum value '" + val + "' in def " + this +
                                               " enum '" + getAncestorString() + id + "'");
    }
Throws if the given value is not legal.
config/src/main/java/com/yahoo/vespa/config/ConfigDefinition.java