All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.rayexpresslibraries.ddd.domain.validation.ValidatorHandler Maven / Gradle / Ivy

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