mirror of
https://github.com/valitydev/adapter-cashreg-spring-boot-starter.git
synced 2024-11-06 09:05:21 +00:00
PROX-364: implements Deserizlizer
This commit is contained in:
parent
e018fa1882
commit
1023782315
@ -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<AdapterState> {
|
||||
@AllArgsConstructor
|
||||
public class AdapterDeserializer implements Deserializer<AdapterState> {
|
||||
|
||||
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<AdapterState> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AdapterState read(String data) {
|
||||
throw new RuntimeException("Not supported");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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<T> implements Deserializer<T> {
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user