@Override
    public String validate(String value) {
      if (value == null || !expected.contains(caseSensitive ? value : value.toLowerCase())) {
        return "Invalid value.. expects one of " + expected;
      }
      return null;
    }
validate value for a ConfVar, return non-null string for fail message
common/src/java/org/apache/hadoop/hive/conf/Validator.java