Class ExceptionMatcher.Builder

java.lang.Object
org.springframework.kafka.support.ExceptionMatcher.Builder
Enclosing class:
ExceptionMatcher

public static class ExceptionMatcher.Builder extends Object
Fluent API for configuring an ExceptionMatcher.
Since:
4.0
Author:
Stephane Nicoll, Dave Syer, Gary Russell
  • Constructor Details

    • Builder

      protected Builder(boolean matchIfFound)
  • Method Details

    • add

      public ExceptionMatcher.Builder add(Class<? extends Throwable> exceptionType)
      Add an exception type.
      Parameters:
      exceptionType - the exception type to add
      Returns:
      this
    • addAll

      public ExceptionMatcher.Builder addAll(Collection<Class<? extends Throwable>> exceptionTypes)
      Add all exception types from the given collection.
      Parameters:
      exceptionTypes - the exception types to add
      Returns:
      this
    • traverseCauses

      public ExceptionMatcher.Builder traverseCauses(boolean traverseCauses)
      Specify if the matcher should traverse nested causes to check for the presence of a matching exception.
      Parameters:
      traverseCauses - whether to traverse causes
      Returns:
      this
    • build

      public ExceptionMatcher build()
      Returns:
      a new exception matcher