@Test public void ensureValidLabelTest() { String[] validLabels = new String[]{ "a", "ab", "ab1", "d_e", "A", "Bc", "B1", "aB", "b-c", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }; for (String label : validLabels) { Validator.ensureValidLabel(label); } }
public static void ensureValidLabel(String label) { if (!validLabel(label)) { throw new ValidationException(String.format("Invalid label: %s", label)); } }
Validator { public static void ensureValidLabel(String label) { if (!validLabel(label)) { throw new ValidationException(String.format("Invalid label: %s", label)); } } }
Validator { public static void ensureValidLabel(String label) { if (!validLabel(label)) { throw new ValidationException(String.format("Invalid label: %s", label)); } } Validator(); }
Validator { public static void ensureValidLabel(String label) { if (!validLabel(label)) { throw new ValidationException(String.format("Invalid label: %s", label)); } } 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 ensureValidLabel(String label) { if (!validLabel(label)) { throw new ValidationException(String.format("Invalid label: %s", label)); } } 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);  }