diff --git a/src/main/java/com/example/cosmos_serversb/jsons/UsersMapJson.java b/src/main/java/com/example/cosmos_serversb/jsons/UsersMapJson.java new file mode 100644 index 0000000..c44487a --- /dev/null +++ b/src/main/java/com/example/cosmos_serversb/jsons/UsersMapJson.java @@ -0,0 +1,29 @@ +package com.example.cosmos_serversb.jsons; + +import com.example.cosmos_serversb.entities.Group; +import com.example.cosmos_serversb.entities.User; + +import java.util.ArrayList; +import java.util.Set; + +public class UsersMapJson { + private ArrayList users = new ArrayList<>(); + + public UsersMapJson(Group group) { + changeUsersMap(group.getMembers()); + } + + public ArrayList getUsers() { + return users; + } + + public void setUsers(ArrayList users) { + this.users = users; + } + + private void changeUsersMap(Set set) { + for (User user : (Set) set) { + users.add(new UidUriJson(user)); + } + } +}