io.metaloom.test.container.provider.server.JSON Maven / Gradle / Ivy
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