T - The type to validate@FunctionalInterface public interface Validator<T>
Validator asserts the validity of a protobuf object.| Modifier and Type | Field and Description |
|---|---|
static Validator |
ALWAYS_INVALID |
static Validator |
ALWAYS_VALID |
| Modifier and Type | Method and Description |
|---|---|
void |
assertValid(T proto)
Asserts validation rules on a protobuf object.
|
default boolean |
isValid(T proto)
Checks validation rules on a protobuf object.
|
static final Validator ALWAYS_VALID
static final Validator ALWAYS_INVALID
void assertValid(T proto) throws ValidationException
proto - the protobuf object to validate.ValidationException - with the first validation error encountered.default boolean isValid(T proto)
proto - the protobuf object to validate.true if all rules are valid, false if not.Copyright © 2022. All rights reserved.