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

io.vertx.up.unity.From Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
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