return invalidData("%s is required when " + when, names);
}
public static InvalidDataException invalidData(String format, String... names) {
if (names == null) {
throw new InvalidDataException(format);
}
return new InvalidDataException(String.format(format, resolveField(names)));
}