Class MessageOptions.Builder<B extends MessageOptions.Builder<B>>

java.lang.Object
com.tick42.glue.core.bus.MessageOptions.Builder<B>
Type Parameters:
B - the concrete type of this builder.
Enclosing class:
MessageOptions

public static class MessageOptions.Builder<B extends MessageOptions.Builder<B>> extends Object
Builder for MessageOptions.
  • Method Details

    • withRoutingKey

      public B withRoutingKey(String routingKey)
      Updates routing key and returns this builder.
      Parameters:
      routingKey - the routing key
      Returns:
      this builder, never null
    • withTarget

      public B withTarget(Map<String,Object> target)
      Updates target and returns this builder.
      Parameters:
      target - the target, may be null
      Returns:
      this builder, never null
      See Also:
    • addTarget

      public B addTarget(Map<String,Object> target)
      Adds missing values from a specified target and returns this builder.
      Parameters:
      target - the target
      Returns:
      this builder, never null
      See Also:
    • withTargetApplication

      public B withTargetApplication(String application)
      Updates "application" value in target and returns this builder.
      Parameters:
      application - the application name
      Returns:
      this builder, never null
    • withTargetUser

      public B withTargetUser(String user)
      Updates "user" value in target and returns this builder.
      Parameters:
      user - the username
      Returns:
      this builder, never null
    • withTargetMachine

      public B withTargetMachine(String machine)
      Updates "machine" value in target and returns this builder.
      Parameters:
      machine - the username
      Returns:
      this builder, never null
    • with

      public B with(MessageOptions options)
      Overwrites this builder values with values from specified message options.
      Parameters:
      options - message options, may be null
      Returns:
      this builder, never null
    • build

      public MessageOptions build()
      Build MessageOptions instance.
      Returns:
      a new MessageOptions instance, never null.