ph.com.nightowlstudios.dto.DTO Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edge Show documentation
Show all versions of edge Show documentation
A simple library for building REST API using Vertx.
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