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

io.metaloom.test.container.provider.server.JSON Maven / Gradle / Ivy

There is a newer version: 0.1.4
Show newest version
package io.metaloom.test.container.provider.server;

import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject;

public final class JSON {

	private JSON() {

	}

	public static Buffer toBuffer(Object obj) {
		return JsonObject.mapFrom(obj).toBuffer();
	}

	public static  T fromBuffer(Buffer buffer, Class classOfT) {
		JsonObject jsonObject = buffer.toJsonObject();
		T obj = jsonObject.mapTo(classOfT);
		return obj;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy