Skip to content

Commit

Permalink
Added convenience method for setting an automatically generated corre…
Browse files Browse the repository at this point in the history
…lation ID to `DittoHeaders`'s builder.

Signed-off-by: Juergen Fickel <juergen.fickel@bosch-si.com>
  • Loading branch information
Juergen Fickel committed Nov 15, 2019
1 parent d4d36d5 commit 6191ceb
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import java.util.Collection;
import java.util.Map;
import java.util.UUID;

import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
Expand Down Expand Up @@ -43,6 +44,15 @@ public interface DittoHeadersBuilder<B extends DittoHeadersBuilder, R extends Di
*/
B correlationId(@Nullable CharSequence correlationId);

/**
* Sets a generated random correlation ID.
*
* @return this builder for Method Chaining.
*/
default B randomCorrelationId() {
return correlationId(String.valueOf(UUID.randomUUID()));
}

/**
* Sets the specified String as source of the command.
*
Expand Down

0 comments on commit 6191ceb

Please sign in to comment.