diff --git a/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyDefaultWriter.java b/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyDefaultWriter.java index 59f89427..a8bfe0e7 100644 --- a/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyDefaultWriter.java +++ b/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyDefaultWriter.java @@ -17,6 +17,4 @@ public static EzyDefaultWriter getInstance() { public Object write(EzyMarshaller marshaller, Object object) { return object; } - - } diff --git a/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyIterableWriter.java b/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyIterableWriter.java index 6b78e1fd..f52cad2d 100644 --- a/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyIterableWriter.java +++ b/ezyfox-binding/src/main/java/com/tvd12/ezyfox/binding/writer/EzyIterableWriter.java @@ -26,5 +26,4 @@ public EzyArray write(EzyMarshaller marshaller, Iterable iterable) { } return builder.build(); } - } diff --git a/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackSimpleSerializer.java b/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackSimpleSerializer.java index 654192c4..66929d7b 100644 --- a/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackSimpleSerializer.java +++ b/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackSimpleSerializer.java @@ -87,7 +87,7 @@ protected void addParsers(Map, EzyParser> parsers) { parsers.put(ArrayList.class, this::parseCollection); parsers.put(BigInteger.class, this::parseValueToString); - parsers.put(BigDecimal.class, this::parseValueToString); + parsers.put(BigDecimal.class, this::parseBigDecimalToString); parsers.put(UUID.class, this::parseValueToString); } @@ -385,6 +385,10 @@ protected byte[] parseMapSize(int size) { return mapSizeSerializer.serialize(size); } + protected byte[] parseBigDecimalToString(Object value) { + return parseString(((BigDecimal) value).toPlainString()); + } + protected byte[] parseValueToString(Object value) { return parseString(value.toString()); } diff --git a/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackToByteBufferSerializer.java b/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackToByteBufferSerializer.java index 995493d9..17c4582b 100644 --- a/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackToByteBufferSerializer.java +++ b/ezyfox-msgpack/src/main/java/com/tvd12/ezyfox/codec/MsgPackToByteBufferSerializer.java @@ -88,7 +88,7 @@ protected void addParsers(Map, EzyParser> parsers) parsers.put(ArrayList.class, this::parseCollection); parsers.put(BigInteger.class, this::parseValueToString); - parsers.put(BigDecimal.class, this::parseValueToString); + parsers.put(BigDecimal.class, this::parseBigDecimalToString); parsers.put(UUID.class, this::parseValueToString); } @@ -384,6 +384,10 @@ protected byte[] parseMapSize(int size) { return mapSizeSerializer.serialize(size); } + protected ByteBuffer parseBigDecimalToString(Object value) { + return parseString(((BigDecimal) value).toPlainString()); + } + protected ByteBuffer parseValueToString(Object value) { return parseString(value.toString()); }