Example usage for io.vertx.core DeploymentOptionsConverter toJson

List of usage examples for io.vertx.core DeploymentOptionsConverter toJson

Introduction

In this page you can find the example usage for io.vertx.core DeploymentOptionsConverter toJson.

Prototype

static void toJson(DeploymentOptions obj, java.util.Map<String, Object> json) 

Source Link

Usage

From source file:com.chibchasoft.vertx.verticle.deployment.DeploymentConfiguration.java

License:Open Source License

/**
 * Returns a JsonObject populated with the information from this object
 * @return The JsonObject/*from  w ww .  jav a 2s . c om*/
 */
public JsonObject toJson() {
    JsonObject json = new JsonObject();
    json.put("name", name);
    if (deploymentOptions != null) {
        JsonObject depOptJson = new JsonObject();
        DeploymentOptionsConverter.toJson(deploymentOptions, depOptJson);
        json.put("deploymentOptions", depOptJson);
    }
    if (this.getDependents() != null) {
        JsonArray array = new JsonArray();
        this.getDependents().forEach(item -> array.add(item.toJson()));
        json.put("dependents", array);
    }
    return json;
}