commit | 8c676db0f70604e1abb0978f966c0916d9ea3aa9 | [log] [tgz] |
---|---|---|
author | Christophe Bornet <cbornet@hotmail.com> | Wed Feb 01 16:01:24 2023 +0100 |
committer | GitHub <noreply@github.com> | Wed Feb 01 17:01:24 2023 +0200 |
tree | 07b8bb0c1bcd5faf0a69c8d7151dd86b89e00950 | |
parent | 20ced033a34af1cfdc4cbf61ea91e0e8a613edad [diff] |
Add getValue to MessageSpec (#120)
diff --git a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/MessageSpec.java b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/MessageSpec.java index d8ac241..394aa36 100644 --- a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/MessageSpec.java +++ b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/MessageSpec.java
@@ -57,4 +57,10 @@ return null; } + /** + * Gets the value of this message spec. + * @return the value of this message spec + */ + T getValue(); + }
diff --git a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/DefaultMessageSpec.java b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/DefaultMessageSpec.java index 8b89945..9635c26 100644 --- a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/DefaultMessageSpec.java +++ b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/DefaultMessageSpec.java
@@ -121,6 +121,11 @@ } @Override + public T getValue() { + return this.value; + } + + @Override public String toString() { StringBuilder stringBuilder = new StringBuilder().append("DefaultMessageSpec{"); stringBuilder.append("value=").append(this.value);
diff --git a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/ValueOnlyMessageSpec.java b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/ValueOnlyMessageSpec.java index c29404b..b116477 100644 --- a/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/ValueOnlyMessageSpec.java +++ b/pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/internal/api/ValueOnlyMessageSpec.java
@@ -44,4 +44,9 @@ return "ValueOnlyMessageSpec{" + "value=" + this.value + '}'; } + @Override + public T getValue() { + return this.value; + } + }