diff --git a/src/main/java/com/example/cosmos_serversb/entities/Group.java b/src/main/java/com/example/cosmos_serversb/entities/Group.java index a29e9a1..4508c5d 100644 --- a/src/main/java/com/example/cosmos_serversb/entities/Group.java +++ b/src/main/java/com/example/cosmos_serversb/entities/Group.java @@ -1,13 +1,17 @@ //このクラスは仮です package com.example.cosmos_serversb.entities; +import com.example.cosmos_serversb.models.Users; + import java.util.ArrayList; +import java.util.HashSet; import java.util.Set; public class Group { private String gId; private String uri, name; - private ArrayList members; + private Set members = new HashSet<>();//HashSetでいいのかな? + //private ArrayList requests; private Set requests; @@ -64,31 +68,28 @@ public void addRequests(Request request){ requests.add(request); } -/* + + /* public ArrayList getRequestsList(){ ArrayList list = new ArrayList(getRequests()); return list; } + */ - */ + public void setMembers(Set members) { + this.members = members; + } + public Set getMembers() { + return members; + } - /*メンバー*/ - //public ArrayList getMembersList(){ - // return null; - //} - - //public void addMemberByUid(String uId){ - // - // members.add(user); - //} - - //public DeleteResult deleteMember(String uid){ - // members.remove(members.indexOf(uid)); - // return null; - //} - - /*リクエスト*/ + public void addMember(String uId){ + //User user = new User(uId, uId, "http:test", "sa", "hogehoge"); + User user = Users.getInstance().getUserById(uId); + members.add(user); + user.addGroups(this); + } }