Newer
Older
CosmosClient / app / src / main / java / com / example / cosmosclient / entities / Group.java
package com.example.cosmosclient.entities;

import com.example.cosmosclient.jsons.RidUriJson;
import com.example.cosmosclient.jsons.UidUriJson;

import java.util.ArrayList;

public class Group {
    private String gId;
    private String uri, name;
    // Userどうする
    private ArrayList<UidUriJson> members = new ArrayList<>();

    private ArrayList<RidUriJson> requests = new ArrayList<>();
//  private Set<User> members = new HashSet<>();
//    private Set<Request> requests;

    public Group(){

    }

    public Group(String gId, String uri, String name, String uId){
        setgId(gId);
        setUri(uri);
        setName(name);
    }

    public String getgId() {
        return gId;
    }

    private void setgId(String gId) {
        this.gId = gId;
    }

    public String getUri() {
        return uri;
    }

    private void setUri(String uri){
        this.uri = uri;
    }

    public String getUriByGid(String gId){
        return uri;
    }

    private void setName(String name){
        this.name = name;
    }

    public String getName(){
        return name;
    }

    public String getNameByGid(String gId){
        return name;
    }

//    public Set<Request> getRequests(){
//        return requests;
//    }
//
//    public void setRequests(Set<Request> requests){
//        this.requests = requests;
//    }

    public void addRequests(RidUriJson request){
        requests.add(request);
    }

//    public ArrayList<Request> getRequestsList(){
//        ArrayList<Request> list = new ArrayList<Request>(getRequests());
//        return list;
//    }

        public ArrayList<RidUriJson> getRequestsList(){
        ArrayList<RidUriJson> list = new ArrayList<RidUriJson>(getRequests());
        return list;
    }

//    public void setMembers(Set<User> members){
//        this.members= members;
//    }
//
//    public Set<User> getMembers(){
//        return members;
//    }

        public void setMembers(ArrayList<UidUriJson> members){
        this.members= members;
    }

    public ArrayList<UidUriJson> getMembers(){
        return members;
    }
        public ArrayList<RidUriJson> getRequests(){
        return requests;
    }

    public void setRequests(ArrayList<RidUriJson> requests){
        this.requests = requests;
    }

    /*メンバー*/
//    public ArrayList<User> getMembersList(){
//        return null;
//    }
//
//    public void addMemberByUid(String uId){
//
//        members.add(user);
//    }
//
//    public DeleteResult deleteMember(String uid){
//        members.remove(members.indexOf(uid));
//        return null;
//    }

    /*リクエスト*/

}