Class OneofEvaluator
java.lang.Object
build.buf.protovalidate.internal.evaluator.OneofEvaluator
- All Implemented Interfaces:
Evaluator
OneofEvaluator performs validation on a oneof union.-
Constructor Summary
ConstructorsConstructorDescriptionOneofEvaluator(com.google.protobuf.Descriptors.OneofDescriptor descriptor, boolean required) Constructs aOneofEvaluator. -
Method Summary
Modifier and TypeMethodDescriptionChecks that the provided val is valid.booleanReturns true if the evaluator always succeeds.
-
Constructor Details
-
OneofEvaluator
public OneofEvaluator(com.google.protobuf.Descriptors.OneofDescriptor descriptor, boolean required) Constructs aOneofEvaluator.- Parameters:
descriptor- The targeted oneof descriptor.required- Indicates whether a member of the oneof must be set.
-
-
Method Details
-
tautology
public boolean tautology()Description copied from interface:EvaluatorReturns true if the evaluator always succeeds. -
evaluate
Description copied from interface:EvaluatorChecks that the provided val is valid. Unless failFast is true, evaluation attempts to find allViolationspresent in val instead of returning aValidationResulton the firstViolation. AnExecutionExceptionis thrown if evaluation fails to complete.- Specified by:
evaluatein interfaceEvaluator- Throws:
ExecutionException
-