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

ph.com.nightowlstudios.dto.DTO Maven / Gradle / Ivy

There is a newer version: 6.21.1
Show newest version
package ph.com.nightowlstudios.dto;

import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;

import java.util.List;

/**
 * @author Joseph Harvey Angeles - yev
 * @since 4/17/21
 **/
public abstract class DTO {

  public JsonObject toJson() {
    return JsonObject.mapFrom(this);
  }

  protected  JsonArray toJsonArray(List objects) {
    JsonArray result = new JsonArray();
    objects.forEach(o -> result.add(JsonObject.mapFrom(o)));
    return result;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy