Newer
Older
CosmosServer / src / main / java / com / example / cosmos_serversb / jsons / UsersMapJson.java
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<UidUriJson> users = new ArrayList<>();

    public UsersMapJson(Group group) {
        changeUsersMap(group.getMembers());
    }

    public ArrayList<UidUriJson> getUsers() {
        return users;
    }

    public void setUsers(ArrayList<UidUriJson> users) {
        this.users = users;
    }

    private void changeUsersMap(Set set) {
        for (User user : (Set<User>) set) {
            users.add(new UidUriJson(user));
        }
    }
}