Package io.envoyproxy.pgv
Class ExplicitValidatorIndex
java.lang.Object
io.envoyproxy.pgv.ExplicitValidatorIndex
- All Implemented Interfaces:
ValidatorIndex
ExplicitValidatorIndex is an explicit registry of Validator instances. If no validator is registered
for type, a fallback validator will be used (default ALWAYS_VALID).-
Field Summary
Fields inherited from interface io.envoyproxy.pgv.ValidatorIndex
ALWAYS_INVALID, ALWAYS_VALID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(Class<T> forType, ValidatorImpl<T> validator) Adds aValidatorto the set of known validators.<T> Validator<T>validatorFor(Class clazz) Returns the validator forclazz, orALWAYS_VALIDif not found.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.envoyproxy.pgv.ValidatorIndex
validatorFor
-
Constructor Details
-
ExplicitValidatorIndex
public ExplicitValidatorIndex() -
ExplicitValidatorIndex
-
-
Method Details
-
add
Adds aValidatorto the set of known validators.- Parameters:
forType- the type to validatevalidator- the validator to apply- Returns:
- this
-
validatorFor
Description copied from interface:ValidatorIndexReturns the validator forclazz, orALWAYS_VALIDif not found.- Specified by:
validatorForin interfaceValidatorIndex
-