package com.example.cosmos_serversb.entities; import java.util.HashSet; import java.util.Set; public class User { public String uId, uri, name, iconUri; public boolean login = true; public Set<Group> groups = new HashSet<>();//HashSetでいいのかな? public User() { } public User(String name, String uId, String uri, String iconUri) { setuId(uId); setUri(uri); setName(name); setIconUri(iconUri); this.login = true; } public String getuId() { return uId; } public void setuId(String uId) { this.uId = uId; } public String getUri() { return uri; } public void setUri(String uri) { this.uri = uri; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getIconUri() { return iconUri; } public void setIconUri(String iconUri) { this.iconUri = iconUri; } public boolean getLogin() { return login; } public void setLogin(boolean login) { this.login = login; } public Set<Group> getGroups() { return groups; } public void setGroups(Set<Group> groups) { this.groups = groups; } public void addGroups(Group group){ //テスト用 //Group group = Groups.getInstance().getGroupByGid(gId); groups.add(group); } }