@Test public void testAnyTypeConstraintAcceptNull() { assertTrue(new TypeConstraint(new PrimitiveType("ImpossibleTypeConstraint") { private static final long serialVersionUID = 1L; @Override public Object convert(Object value) throws TypeException { return value; } @Override public boolean validate(Object object) { return false; } @Override public boolean support(Class<? extends Constraint> constraint) { return false; } }).validate(null)); }
@Override public boolean validate(Object object) { if (object == null) { return true; } return type.validate(object); }
TypeConstraint extends AbstractConstraint { @Override public boolean validate(Object object) { if (object == null) { return true; } return type.validate(object); } }
TypeConstraint extends AbstractConstraint { @Override public boolean validate(Object object) { if (object == null) { return true; } return type.validate(object); } TypeConstraint(PrimitiveType type); }
TypeConstraint extends AbstractConstraint { @Override public boolean validate(Object object) { if (object == null) { return true; } return type.validate(object); } TypeConstraint(PrimitiveType type); @Override boolean validate(Object object); @Override Description getDescription(); Type getType(); @Override int hashCode(); @Override boolean equals(Object obj); }
TypeConstraint extends AbstractConstraint { @Override public boolean validate(Object object) { if (object == null) { return true; } return type.validate(object); } TypeConstraint(PrimitiveType type); @Override boolean validate(Object object); @Override Description getDescription(); Type getType(); @Override int hashCode(); @Override boolean equals(Object obj);  }