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

io.envoyproxy.pgv.ValidatorImpl Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package io.envoyproxy.pgv;

/**
 * {@code Validator} is the base interface for all generated PGV validators.
 * @param  The type to validate
 */
@FunctionalInterface
public interface ValidatorImpl {
    /**
     * Asserts validation rules on a protobuf object.
     *
     * @param proto the protobuf object to validate.
     * @throws ValidationException with the first validation error encountered.
     */
    void assertValid(T proto, ValidatorIndex index) throws ValidationException;

    ValidatorImpl ALWAYS_VALID = (proto, index) -> {
        // Do nothing. Always valid.
    };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy