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

import com.example.cosmosclient.entities.jsons.GroupJson;

import java.util.ArrayList;
import java.util.Set;

public class Group {
    private String gId;
    private String uri, name;
    private long requestHash;
    /*   Userどうするか
    private ArrayList<User> members;
    */
    private RequestList requestList;

    public Group(){

    }

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

    public Group(GroupJson groupJson){
        setgId(groupJson.getgId());
        setUri(groupJson.getUri());
        clearRequestHash();
        setName(groupJson.getName());
    }

    public String getgId() {
        return gId;
    }

    public 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 long getRequestHash() {
        return requestHash;
    }

    public void setRequestHash(long requestHash) {
        this.requestHash = requestHash;
    }

    public void clearRequestHash(){
        setRequestHash(0);
    }

    public void updateRequestHash(){
        setRequestHash(getRequestHash()+1);
    }

    public RequestList getRequestList(){
        return requestList;
    }

    public void setRequestList(RequestList requestList){
        this.requestList = requestList;
    }

    /*メンバー*/
    //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;
    //}
}