com.nhl.link.rest.client.runtime.jackson.JsonEntityReaderFactory Maven / Gradle / Ivy
package com.nhl.link.rest.client.runtime.jackson;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.databind.JsonNode;
/**
* @since 2.0
*/
public class JsonEntityReaderFactory implements IJsonEntityReaderFactory {
private Map, IJsonEntityReader>> readerMap;
public JsonEntityReaderFactory() {
readerMap = new HashMap<>();
readerMap.put(JsonNode.class, new JsonEntityReader());
}
@SuppressWarnings("unchecked")
@Override
public IJsonEntityReader getReaderForType(Class targetType) {
if (targetType == null) {
throw new NullPointerException("Target type");
}
return (IJsonEntityReader) readerMap.get(targetType);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy