package com.m2pool.lease.netty.parser;


import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.m2pool.lease.netty.message.ServerConfigurationMining;
import com.m2pool.lease.netty.message.ServerMessage;

public class ServerConfigMiningParser implements MessageParser<ServerMessage<ServerConfigurationMining>> {
    @Override
    public ServerMessage<ServerConfigurationMining> parse(ObjectMapper objectMapper, String jsonStr) throws Exception {
        return objectMapper.readValue(jsonStr, getTypeReference());
    }

    @Override
    public TypeReference<ServerMessage<ServerConfigurationMining>> getTypeReference() {
        return new TypeReference<ServerMessage<ServerConfigurationMining>>() {};
    }
}
