// Path: src/main/java/de/cgrotz/kademlia/protocol/Codec.java
// public class Codec {
//     private final Base64.Decoder decoder = Base64.getDecoder();
//     private final Base64.Encoder encoder = Base64.getEncoder();
// 
//     private final Gson gson = new GsonBuilder()
//             .registerTypeAdapter(Message.class, new MessageTypeAdapter())
//             .registerTypeAdapter(Listener.class, new ListenerMessageTypeAdapter())
//             //.registerTypeAdapter(UdpListener.class, new UdpListenerMessageTypeAdapter())
//             .create();
// 
//     public Message decode(byte[] buffer) throws UnsupportedEncodingException {
//         Message message = gson.fromJson(new String(buffer, StandardCharsets.UTF_8).trim(), Message.class);
//         return message;
//     }
// 
//     public byte[] encode(Message msg) {
//         return gson.toJson(msg).getBytes();
//     }
// }
// 
// Path: src/main/java/de/cgrotz/kademlia/protocol/Message.java
// @Data
// public abstract class Message {
//     private final MessageType type;
//     private final long seqId;
// 
//     private final Node origin;
// }


import de.cgrotz.kademlia.protocol.Codec;
import de.cgrotz.kademlia.protocol.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.DatagramPacket;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
package de.cgrotz.kademlia.client;



/**
 * Created by Christoph on 24.09.2016.
 */
public class KademliaClientHandler {

    private final static Logger LOGGER = LoggerFactory.getLogger(KademliaClientHandler.class);

// Path: src/main/java/de/cgrotz/kademlia/protocol/Codec.java
// public class Codec {
//     private final Base64.Decoder decoder = Base64.getDecoder();
//     private final Base64.Encoder encoder = Base64.getEncoder();
// 
//     private final Gson gson = new GsonBuilder()
//             .registerTypeAdapter(Message.class, new MessageTypeAdapter())
//             .registerTypeAdapter(Listener.class, new ListenerMessageTypeAdapter())
//             //.registerTypeAdapter(UdpListener.class, new UdpListenerMessageTypeAdapter())
//             .create();
// 
//     public Message decode(byte[] buffer) throws UnsupportedEncodingException {
//         Message message = gson.fromJson(new String(buffer, StandardCharsets.UTF_8).trim(), Message.class);
//         return message;
//     }
// 
//     public byte[] encode(Message msg) {
//         return gson.toJson(msg).getBytes();
//     }
// }
// 
// Path: src/main/java/de/cgrotz/kademlia/protocol/Message.java
// @Data
// public abstract class Message {
//     private final MessageType type;
//     private final long seqId;
// 
//     private final Node origin;
// }


// Path: src/main/java/de/cgrotz/kademlia/client/KademliaClientHandler.java
import de.cgrotz.kademlia.protocol.Codec;
import de.cgrotz.kademlia.protocol.Message;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.DatagramPacket;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;

package de.cgrotz.kademlia.client;



/**
 * Created by Christoph on 24.09.2016.
 */
public class KademliaClientHandler {

    private final static Logger LOGGER = LoggerFactory.getLogger(KademliaClientHandler.class);

    private final Codec codec = new Codec();