package io.reactiverse.pgclient.data;
import io.reactiverse.pgclient.impl.data.JsonImpl;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
@VertxGen
public interface Json {
static Json create(Object value) {
if (value == null) {
return JsonImpl.NULL;
} else if (value instanceof String || value instanceof Number || value instanceof JsonObject || value instanceof JsonArray || value instanceof Boolean) {
return new JsonImpl(value);
} else {
throw new IllegalArgumentException("Invalid json value " + value + " with class " + value.getClass().getName());
}
}
Object value();
}