Newer
Older
CosmosServer / src / main / java / com / example / cosmos_serversb / jsons / UsersMapJson.java
  1. package com.example.cosmos_serversb.jsons;
  2.  
  3. import com.example.cosmos_serversb.entities.Group;
  4. import com.example.cosmos_serversb.entities.User;
  5.  
  6. import java.util.ArrayList;
  7. import java.util.Set;
  8.  
  9. public class UsersMapJson {
  10. private ArrayList<UidUriJson> users = new ArrayList<>();
  11.  
  12. public UsersMapJson(Group group) {
  13. changeUsersMap(group.getMembers());
  14. }
  15.  
  16. public ArrayList<UidUriJson> getUsers() {
  17. return users;
  18. }
  19.  
  20. public void setUsers(ArrayList<UidUriJson> users) {
  21. this.users = users;
  22. }
  23.  
  24. private void changeUsersMap(Set set) {
  25. for (User user : (Set<User>) set) {
  26. users.add(new UidUriJson(user));
  27. }
  28. }
  29. }