@Test public void testSupports() { NotEmptyValidator notEmptyValidator = new NotEmptyValidator(ValidationScope.ALL, "violationMessage"); assertTrue(notEmptyValidator.supports(new HashSet<String>())); assertTrue(notEmptyValidator.supports(new ArrayList<String>())); assertTrue(notEmptyValidator.supports(new HashMap<String, String>())); assertFalse(notEmptyValidator.supports(new String[1])); assertTrue(notEmptyValidator.supports(new ArrayDeque<String>())); List<AtlasValidator> validators = new ArrayList<>(); validators.add(notEmptyValidator); CompositeValidator compositeValidator = new CompositeValidator(validators); assertFalse(compositeValidator.supports(NotEmptyValidator.class)); assertTrue(compositeValidator.supports(List.class)); }
@Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; }
CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } }
CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators);  CompositeValidator(AtlasValidator... validators); }
CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators);  CompositeValidator(AtlasValidator... validators); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void validate(Object target, List<Validation> validations, String id, ValidationStatus status); }
CompositeValidator implements AtlasValidator { @Override public boolean supports(Class<?> clazz) { for (AtlasValidator validator : validators) { if (validator.supports(clazz)) { return true; } } return false; } CompositeValidator(List<AtlasValidator> validators);  CompositeValidator(AtlasValidator... validators); @Override boolean supports(Class<?> clazz); @Override void validate(Object target, List<Validation> validations, String id); @Override void validate(Object target, List<Validation> validations, String id, ValidationStatus status);  }