Class BaseExchangeBuilder<B extends BaseExchangeBuilder<B>>

java.lang.Object
org.springframework.amqp.core.AbstractBuilder
org.springframework.amqp.core.BaseExchangeBuilder<B>
Type Parameters:
B - the target class implementation type.
Direct Known Subclasses:
ExchangeBuilder, ExchangeBuilder.ConsistentHashExchangeBuilder

public abstract class BaseExchangeBuilder<B extends BaseExchangeBuilder<B>> extends AbstractBuilder
An AbstractBuilder extension for generics support.
Since:
3.2
Author:
Gary Russell, Artem Bilan
  • Field Details

    • name

      protected final String name
    • type

      protected final String type
    • durable

      protected boolean durable
    • autoDelete

      protected boolean autoDelete
    • internal

      protected boolean internal
  • Constructor Details

    • BaseExchangeBuilder

      public BaseExchangeBuilder(String name, String type)
      Construct an instance of the appropriate type.
      Parameters:
      name - the exchange name
      type - the type name
      Since:
      1.6.7
      See Also:
  • Method Details

    • autoDelete

      public B autoDelete()
      Set the auto delete flag.
      Returns:
      the builder.
    • durable

      public B durable(boolean isDurable)
      Set the durable flag.
      Parameters:
      isDurable - the durable flag (default true).
      Returns:
      the builder.
    • withArgument

      public B withArgument(String key, Object value)
      Add an argument.
      Parameters:
      key - the argument key.
      value - the argument value.
      Returns:
      the builder.
    • withArguments

      public B withArguments(Map<String,Object> arguments)
      Add the arguments.
      Parameters:
      arguments - the arguments map.
      Returns:
      the builder.
    • alternate

      public B alternate(String exchange)
    • internal

      public B internal()
      Set the internal flag.
      Returns:
      the builder.
    • delayed

      public B delayed()
      Set the delayed flag.
      Returns:
      the builder.
    • ignoreDeclarationExceptions

      public B ignoreDeclarationExceptions()
      Switch on ignore exceptions such as mismatched properties when declaring.
      Returns:
      the builder.
      Since:
      2.0
    • suppressDeclaration

      public B suppressDeclaration()
      Switch to disable declaration of the exchange by any admin.
      Returns:
      the builder.
      Since:
      2.1
    • admins

      public B admins(Object... admins)
      Admin instances, or admin bean names that should declare this exchange.
      Parameters:
      admins - the admins.
      Returns:
      the builder.
      Since:
      2.1
    • build

      public <T extends Exchange> T build()
    • configureExchange

      protected <T extends AbstractExchange> T configureExchange(T exchange)
    • _this

      protected final B _this()