public static Mirror create(final Class<?> clazz) { return new Mirror(clazz); }
void bind(final String pojo, final Class<?> clazz) { if (Ut.isNil(pojo)) { this.pojoFile = null; this.pojo = null; } else { LOGGER.debug(Info.JOOQ_BIND, pojo, clazz); this.pojoFile = pojo; this.pojo = Mirror.create(UxJooq.class).mount(pojo) .mojo().put(this.mapping); // When bind pojo, the system will analyze columns LOGGER.debug(Info.JOOQ_MOJO, this.pojo.getRevert(), this.pojo.getColumns()); } }
static <R> R init( final Annal logger, final String key, final JsonObject config, final Function<JsonObject, R> executor) { Fn.outUp(() -> Ruler.verify(key, config), logger); return executor.apply(config); }
private static JsonArray projection(final JsonArray projections, final Mojo mojo) { final JsonArray result = new JsonArray(); final ConcurrentMap<String, String> mapping = mojo.getRevert(); Ut.itJArray(projections, String.class, (item, index) -> result.add(null == mapping.get(item) ? item : mapping.get(item))); return result; } }
public Mirror type(final Class<?> entityCls) { this.mojo.setType(entityCls); return this; }
@SuppressWarnings("unchecked") public <T> T get() { final Object reference = Ut.deserialize(this.converted, this.mojo.getType()); return Fn.getNull(null, () -> (T) reference, reference); }
void bind(final String pojo, final Class<?> clazz) { if (Ut.isNil(pojo)) { this.pojoFile = null; this.pojo = null; } else { LOGGER.debug(Info.JOOQ_BIND, pojo, clazz); this.pojoFile = pojo; this.pojo = Mirror.create(UxJooq.class).mount(pojo) .mojo().put(this.mapping); // When bind pojo, the system will analyze columns LOGGER.debug(Info.JOOQ_MOJO, this.pojo.getRevert(), this.pojo.getColumns()); } }
@Override public Cliff transform(final JsonObject input) { Fn.outUp(() -> Ruler.verify("wall-mongo", input), LOGGER); final Cliff cliff = new Cliff(); cliff.setType(WallType.MONGO); cliff.setConfig(input.getJsonObject("config")); return cliff; } }
public static Mirror create(final Class<?> clazz) { return new Mirror(clazz); }
public Mirror type(final Class<?> entityCls) { this.mojo.setType(entityCls); return this; }
@SuppressWarnings("unchecked") public <T> T get() { final Object reference = Ut.deserialize(this.converted, this.mojo.getType()); return Fn.getNull(null, () -> (T) reference, reference); }
@Override public Cliff transform(final JsonObject input) { Fn.outUp(() -> Ruler.verify("wall-jwt", input), LOGGER); final Cliff cliff = new Cliff(); cliff.setType(WallType.JWT); cliff.setConfig(input.getJsonObject("config")); return cliff; } }