Commit 846910b0 authored by Florian Schäfer's avatar Florian Schäfer

Simplify API of CustomDeserializer

The mapper doesn't have to be given as parameter when implementors can simply access it as protected field.
parent 50072358
......@@ -10,7 +10,7 @@ import java.io.IOException;
import java.util.Objects;
public abstract class CustomDeserializer<T> extends StdDeserializer<T> {
private final ObjectMapper mapper;
protected final ObjectMapper mapper;
protected CustomDeserializer(final ObjectMapper mapper) {
super((Class<?>) null);
......@@ -18,9 +18,9 @@ public abstract class CustomDeserializer<T> extends StdDeserializer<T> {
}
@Override
public final T deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
return deserialize(p.getCodec().readTree(p), mapper);
public final T deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
return deserialize(p.getCodec().readTree(p));
}
public abstract T deserialize(final JsonNode node, final ObjectMapper mapper) throws JsonProcessingException;
public abstract T deserialize(final JsonNode node) throws JsonProcessingException;
}
......@@ -130,7 +130,7 @@ public final class WbgetclaimsResult {
}
@Override
public DataValue deserialize(JsonNode node, ObjectMapper mapper) throws JsonProcessingException {
public DataValue deserialize(final JsonNode node) throws JsonProcessingException {
final JsonNode type = node.get("type");
final JsonNode nodeValue = node.get("value");
switch (type.textValue()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment