diff --git a/src/main/java/io/lettuce/core/output/NestedMultiOutput.java b/src/main/java/io/lettuce/core/output/NestedMultiOutput.java index 51949e4587..b137f92eff 100644 --- a/src/main/java/io/lettuce/core/output/NestedMultiOutput.java +++ b/src/main/java/io/lettuce/core/output/NestedMultiOutput.java @@ -32,6 +32,7 @@ * @param Value type. * @author Will Glozer * @author Mark Paluch + * @author Julien Ruaux */ public class NestedMultiOutput extends CommandOutput> { @@ -57,6 +58,16 @@ public void set(long integer) { output.add(integer); } + @Override + public void set(double number) { + + if (!initialized) { + output = new ArrayList<>(); + } + + output.add(number); + } + @Override public void set(ByteBuffer bytes) { diff --git a/src/test/java/io/lettuce/core/output/NestedMultiOutputUnitTests.java b/src/test/java/io/lettuce/core/output/NestedMultiOutputUnitTests.java index 18fdc5eed9..20cb887257 100644 --- a/src/test/java/io/lettuce/core/output/NestedMultiOutputUnitTests.java +++ b/src/test/java/io/lettuce/core/output/NestedMultiOutputUnitTests.java @@ -35,4 +35,15 @@ void nestedMultiError() { output.setError(StandardCharsets.US_ASCII.encode("Oops!")); assertThat(output.getError()).isNotNull(); } + + @Test + void nestedMultiDouble() { + NestedMultiOutput output = new NestedMultiOutput<>(StringCodec.UTF8); + double value = 123.456; + output.set(value); + assertThat(output.get()).isNotNull(); + assertThat(output.get()).size().isEqualTo(1); + assertThat(output.get().get(0)).isEqualTo(value); + } + }