[New] Added new method ResponseUtil.listToResponse()

This commit is contained in:
Robert von Burg 2018-02-27 18:01:37 +01:00
parent ae405492e9
commit 5745f3c1d1
1 changed files with 4 additions and 0 deletions

View File

@ -82,6 +82,10 @@ public class ResponseUtil {
return toResponse(member, list.stream().map(toJson).collect(Collectors.toList()));
}
public static <T> Response listToResponse(String member, List<T> list, Function<T, JsonObject> toJson) {
return toResponse(member, list.stream().map(toJson).collect(Collectors.toList()));
}
public static Response toResponse(String member, List<JsonObject> jsonObjects) {
JsonObject response = new JsonObject();
response.addProperty(MSG, StringHelper.DASH);