io.vertx.up.unity.From Maven / Gradle / Ivy
package io.vertx.up.unity;
import io.vertx.core.json.JsonObject;
import io.vertx.up.atom.Mirror;
import io.vertx.up.atom.Mojo;
import io.vertx.up.util.Ut;
import io.vertx.up.fn.Fn;
class From {
static T fromJson(final JsonObject data, final Class clazz, final String pojo) {
return Fn.getSemi(Ut.isNil(pojo), null,
() -> Ut.deserialize(data, clazz),
() -> Mirror.create(From.class)
.mount(pojo)
.connect(data)
.type(clazz)
.from()
.get());
}
static JsonObject fromJson(final JsonObject criteria, final String pojo) {
final Mojo mojo = Mirror.create(From.class).mount(pojo).mojo();
return Query.criteria(criteria, mojo);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy