All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.aipark.api.webservice.jsonConverter.aiparkapi.TileDeserializer Maven / Gradle / Ivy

package de.aipark.api.webservice.jsonConverter.aiparkapi;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.KeyDeserializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.aipark.api.tile.Tile;

import java.io.IOException;

/**
 * Created by torgen on 25.09.17.
 */
public class TileDeserializer extends KeyDeserializer {
    ObjectMapper objectMapper;

    public TileDeserializer() {
        objectMapper = new ObjectMapper();
    }

    @Override
    public Tile deserializeKey(String key, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        try {
            return objectMapper.readValue(key,Tile.class);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy