diff --git a/src/main/java/com/example/cosmos_serversb/jsons/GroupJson.java b/src/main/java/com/example/cosmos_serversb/jsons/GroupJson.java index 9557209..2b2a534 100644 --- a/src/main/java/com/example/cosmos_serversb/jsons/GroupJson.java +++ b/src/main/java/com/example/cosmos_serversb/jsons/GroupJson.java @@ -5,6 +5,7 @@ import com.example.cosmos_serversb.entities.Request; import com.example.cosmos_serversb.entities.User; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -12,15 +13,15 @@ public class GroupJson { private String gId; private String uri, name; - private Map members = new HashMap<>();//HashSetでいいのかな? - private Map requests = new HashMap<>(); + private ArrayList members = new ArrayList<>(); + private ArrayList requests = new ArrayList<>(); public GroupJson(Group group){ setgId(group.getgId()); setUri(group.getUri()); setName(group.getName()); - changeMembersMap(group.getMembers()); - changeRequestsMap(group.getRequests()); + createUidUri(group.getMembers()); + createRidUri(group.getRequests()); } public String getgId() { @@ -55,36 +56,33 @@ return name; } - public Map getMembers() { + public ArrayList getMembers() { return members; } - public void setMembers(Map members) { + public void setMembers(ArrayList members) { this.members = members; } - public Map getRequests() { + public ArrayList getRequest() { return requests; } - public void setRequests(Map requests) { + public void setRequests(ArrayList requests) { this.requests = requests; } - private void changeMembersMap(Set set){ + private void createUidUri(Set set){ for ( User user : (Set) set ) { - members.put(user.getuId(), getUri()); + members.add( new UidUriJson(user) ); } } - private void changeRequestsMap(Set set){ + private void createRidUri(Set set){ for ( Request request : (Set) set ) { - requests.put(request.getrId(), getUri()); + requests.add( new RidUriJson(request) ); } } - - - }