From 1023782315b94f4f4241ecb751572881c5cf092c Mon Sep 17 00:00:00 2001 From: avcherkasov Date: Tue, 5 Nov 2019 15:03:12 +0300 Subject: [PATCH] PROX-364: implements Deserizlizer --- .../deserializer/AdapterDeserializer.java | 17 ++++++++++--- .../state/deserializer/StateDeserializer.java | 25 ------------------- 2 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/StateDeserializer.java diff --git a/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/AdapterDeserializer.java b/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/AdapterDeserializer.java index 91e63f7..9ae1645 100644 --- a/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/AdapterDeserializer.java +++ b/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/AdapterDeserializer.java @@ -2,17 +2,21 @@ package com.rbkmoney.adapter.cashreg.spring.boot.starter.state.deserializer; import com.fasterxml.jackson.databind.ObjectMapper; import com.rbkmoney.adapter.cashreg.spring.boot.starter.model.AdapterState; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; import org.springframework.stereotype.Component; import java.io.IOException; +@Getter +@Setter @Component -public class AdapterDeserializer extends StateDeserializer { +@AllArgsConstructor +public class AdapterDeserializer implements Deserializer { - public AdapterDeserializer(ObjectMapper mapper) { - super(mapper); - } + private final ObjectMapper mapper; public AdapterState read(byte[] data) { if (data == null) { @@ -25,4 +29,9 @@ public class AdapterDeserializer extends StateDeserializer { } } + @Override + public AdapterState read(String data) { + throw new RuntimeException("Not supported"); + } + } diff --git a/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/StateDeserializer.java b/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/StateDeserializer.java deleted file mode 100644 index b42f402..0000000 --- a/src/main/java/com/rbkmoney/adapter/cashreg/spring/boot/starter/state/deserializer/StateDeserializer.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.rbkmoney.adapter.cashreg.spring.boot.starter.state.deserializer; - -import com.fasterxml.jackson.databind.ObjectMapper; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.Setter; - -@Getter -@Setter -@AllArgsConstructor -public abstract class StateDeserializer implements Deserializer { - - protected final ObjectMapper mapper; - - @Override - public T read(byte[] data) { - throw new RuntimeException("Not supported"); - } - - @Override - public T read(String data) { - throw new RuntimeException("Not supported"); - } - -}