Example usage for io.vertx.core.json JsonObject mapFrom

List of usage examples for io.vertx.core.json JsonObject mapFrom

Introduction

In this page you can find the example usage for io.vertx.core.json JsonObject mapFrom.

Prototype

@SuppressWarnings("unchecked")
public static JsonObject mapFrom(Object obj) 

Source Link

Document

Create a JsonObject from the fields of a Java object.

Usage

From source file:org.jberet.vertx.rest.JBeretRouterConfig.java

License:Open Source License

private static void getJobSchedules(final RoutingContext routingContext) {
    final LocalMap<String, JobSchedule> timerLocalMap = getTimerLocalMap(routingContext.vertx());
    final JsonArray jsonArray = new JsonArray();
    for (JobSchedule jobSchedule : timerLocalMap.values()) {
        jsonArray.add(JsonObject.mapFrom(jobSchedule));
    }/*from  w ww. j  ava  2 s  .  com*/
    sendJsonResponse(routingContext, jsonArray.encodePrettily());
}

From source file:org.jberet.vertx.rest.JBeretRouterConfig.java

License:Open Source License

private static void getJobSchedule(final RoutingContext routingContext) {
    final JobSchedule jobSchedule = lookupJobScheduleWithPathParam(routingContext);
    final JsonObject jsonObject = JsonObject.mapFrom(jobSchedule);
    sendJsonResponse(routingContext, jsonObject.encodePrettily());
}