io.github.rayexpresslibraries.ddd.domain.validation.ValidatorHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ddd Show documentation
Show all versions of ddd Show documentation
a libary that contain comon classes about ddd
The newest version!
package io.github.rayexpresslibraries.ddd.domain.validation;
import java.util.List;
public interface ValidatorHandler {
ValidatorHandler append(Error error);
ValidatorHandler append(ValidatorHandler handler);
T validate(Validation aValidation);
default boolean hasErrors() {
return getErrors() != null && !getErrors().isEmpty();
}
List getErrors();
interface Validation {
T validate();
}
default Error firstError() {
return getErrors() == null || getErrors().isEmpty() ? null : getErrors().get(0);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy