@Test public void testEnumConstraintDescription() { Constraint.Description description = simple.getDescription(); assertEquals("EnumConstraint", description.getName()); Map<String, Serializable> params = description.getParameters(); assertEquals(1, params.size()); assertTrue(params.containsKey("Values")); Serializable values = params.get("Values"); assertTrue(values instanceof Collection); assertTrue(((Collection<?>) values).contains("one")); assertTrue(((Collection<?>) values).contains("two")); assertTrue(((Collection<?>) values).contains("three")); }
@Override public Description getDescription() { Map<String, Serializable> params = new HashMap<>(); params.put(EnumConstraint.PNAME_VALUES, new ArrayList<>(possibleValues)); return new Description(EnumConstraint.NAME, params); }
EnumConstraint extends AbstractConstraint { @Override public Description getDescription() { Map<String, Serializable> params = new HashMap<>(); params.put(EnumConstraint.PNAME_VALUES, new ArrayList<>(possibleValues)); return new Description(EnumConstraint.NAME, params); } }
EnumConstraint extends AbstractConstraint { @Override public Description getDescription() { Map<String, Serializable> params = new HashMap<>(); params.put(EnumConstraint.PNAME_VALUES, new ArrayList<>(possibleValues)); return new Description(EnumConstraint.NAME, params); } EnumConstraint(List<?> possibleValues);  EnumConstraint(Object... possibleValues); }
EnumConstraint extends AbstractConstraint { @Override public Description getDescription() { Map<String, Serializable> params = new HashMap<>(); params.put(EnumConstraint.PNAME_VALUES, new ArrayList<>(possibleValues)); return new Description(EnumConstraint.NAME, params); } EnumConstraint(List<?> possibleValues);  EnumConstraint(Object... possibleValues); @Override boolean validate(Object object); @Override Description getDescription(); Set<String> getPossibleValues(); @Override String getErrorMessage(Object invalidValue, Locale locale); @Override int hashCode(); @Override boolean equals(Object obj); }
EnumConstraint extends AbstractConstraint { @Override public Description getDescription() { Map<String, Serializable> params = new HashMap<>(); params.put(EnumConstraint.PNAME_VALUES, new ArrayList<>(possibleValues)); return new Description(EnumConstraint.NAME, params); } EnumConstraint(List<?> possibleValues);  EnumConstraint(Object... possibleValues); @Override boolean validate(Object object); @Override Description getDescription(); Set<String> getPossibleValues(); @Override String getErrorMessage(Object invalidValue, Locale locale); @Override int hashCode(); @Override boolean equals(Object obj);  }