Interface ReactiveValidator
- All Known Implementing Classes:
DefaultAnnotatedElementValidator
,DefaultValidator
public interface ReactiveValidator
Interface for reactive bean validation.
- Since:
- 1.2
- Author:
- graemerocher
-
Method Summary
Modifier and TypeMethodDescription<T> @NonNull CompletionStage<T>
validateCompletionStage
(@NonNull CompletionStage<T> completionStage, @NonNull io.micronaut.core.type.Argument<T> argument, Class<?>... groups) Validate the given CompletionStage by returning a new CompletionStage that validates the emitted value.<T> @NonNull org.reactivestreams.Publisher<T>
validatePublisher
(@NonNull io.micronaut.core.type.ReturnType<?> returnType, @NonNull org.reactivestreams.Publisher<T> publisher, Class<?>... groups) Validate the given publisher by returning a new Publisher that validates each emitted value.
-
Method Details
-
validatePublisher
@NonNull <T> @NonNull org.reactivestreams.Publisher<T> validatePublisher(@NonNull @NonNull io.micronaut.core.type.ReturnType<?> returnType, @NonNull @NonNull org.reactivestreams.Publisher<T> publisher, Class<?>... groups) Validate the given publisher by returning a new Publisher that validates each emitted value. If a constraint violation error occurs aConstraintViolationException
will be thrown.- Type Parameters:
T
- The generic type- Parameters:
returnType
- The required type of publisherpublisher
- The publishergroups
- The groups- Returns:
- The publisher
-
validateCompletionStage
@NonNull <T> @NonNull CompletionStage<T> validateCompletionStage(@NonNull @NonNull CompletionStage<T> completionStage, @NonNull @NonNull io.micronaut.core.type.Argument<T> argument, Class<?>... groups) Validate the given CompletionStage by returning a new CompletionStage that validates the emitted value. If a constraint violation error occurs aConstraintViolationException
will be thrown.- Type Parameters:
T
- The generic type- Parameters:
completionStage
- The completion stageargument
- The completion stage element argumentgroups
- The groups- Returns:
- The publisher
-