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.ClientConfigurationMining;
import com.m2pool.lease.netty.message.ClientMessage;

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

    @Override
    public TypeReference<ClientMessage<ClientConfigurationMining>> getTypeReference() {
        return new TypeReference<ClientMessage<ClientConfigurationMining>>() {};
    }
}
