use of io.atlasmap.v2.ValidationStatus in project atlasmap by atlasmap.
the class PositiveIntegerValidator method validate.
@Override
public void validate(Object target, List<Validation> validations, String id, ValidationStatus status) {
Integer value = (Integer) target;
if (value == null || value < 0) {
Validation validation = new Validation();
validation.setScope(scope);
validation.setId(id);
validation.setMessage(String.format(violationMessage, target != null ? target.toString() : null));
validation.setStatus(status);
validations.add(validation);
}
}
Aggregations