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

com.github.hekonsek.vertx.pipes.internal.LinkedHashMapJsonCodec Maven / Gradle / Ivy

There is a newer version: 0.4
Show newest version
package com.github.hekonsek.vertx.pipes.internal;

import io.vertx.core.buffer.Buffer;
import io.vertx.core.eventbus.MessageCodec;
import io.vertx.core.json.Json;

import java.util.LinkedHashMap;

public class LinkedHashMapJsonCodec implements MessageCodec {

    @Override public void encodeToWire(Buffer buffer, LinkedHashMap LinkedHashMap) {
        buffer.appendString(Json.encode(LinkedHashMap));
    }

    @Override public LinkedHashMap decodeFromWire(int pos, Buffer buffer) {
        return Json.decodeValue(buffer, LinkedHashMap.class);
    }

    @Override public LinkedHashMap transform(LinkedHashMap LinkedHashMap) {
        return LinkedHashMap;
    }

    @Override public String name() {
        return getClass().getSimpleName();
    }

    @Override public byte systemCodecID() {
        return -1;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy