package com.example.cosmos_serversb.jsons; import com.example.cosmos_serversb.entities.Request; import java.util.ArrayList; import java.util.Set; public class RequestsJson { public ArrayList<RequestJson> requests; public RequestsJson(Set<Request> set){ changeRequests(set); } public ArrayList<RequestJson> getRequests(){ return requests; } public void setRequests(ArrayList<RequestJson> requests) { this.requests = requests; } public void changeRequests(Set<Request> set){ // requests = new ArrayList<RequestJson>(set); for( Request request : (Set<Request>) set ) { requests.add(new RequestJson(request)); } } }