@Test public void ensureValidFieldNameTest() { String[] validFieldNames = new String[]{ "a", "ab", "ab1", "b-c", "d_e", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; for (String name : validFieldNames) { Validator.ensureValidFieldName(name); } }
public static void ensureValidFieldName(String fieldName) { if (!validFieldName(fieldName)) { throw new ValidationException(String.format("Invalid field name: %s", fieldName)); } }
Validator { public static void ensureValidFieldName(String fieldName) { if (!validFieldName(fieldName)) { throw new ValidationException(String.format("Invalid field name: %s", fieldName)); } } }
Validator { public static void ensureValidFieldName(String fieldName) { if (!validFieldName(fieldName)) { throw new ValidationException(String.format("Invalid field name: %s", fieldName)); } } Validator(); }
Validator { public static void ensureValidFieldName(String fieldName) { if (!validFieldName(fieldName)) { throw new ValidationException(String.format("Invalid field name: %s", fieldName)); } } Validator(); @SuppressWarnings("WeakerAccess") static boolean validIndexName(String indexName); static void ensureValidIndexName(String indexName); @SuppressWarnings("WeakerAccess") static boolean validFieldName(String fieldName); static void ensureValidFieldName(String fieldName); @SuppressWarnings("WeakerAccess") static boolean validLabel(String label); static void ensureValidLabel(String label); @SuppressWarnings("WeakerAccess") static boolean validKey(String key); static void ensureValidKey(String key); }
Validator { public static void ensureValidFieldName(String fieldName) { if (!validFieldName(fieldName)) { throw new ValidationException(String.format("Invalid field name: %s", fieldName)); } } Validator(); @SuppressWarnings("WeakerAccess") static boolean validIndexName(String indexName); static void ensureValidIndexName(String indexName); @SuppressWarnings("WeakerAccess") static boolean validFieldName(String fieldName); static void ensureValidFieldName(String fieldName); @SuppressWarnings("WeakerAccess") static boolean validLabel(String label); static void ensureValidLabel(String label); @SuppressWarnings("WeakerAccess") static boolean validKey(String key); static void ensureValidKey(String key);  }