package com.data.bean;

import java.util.Map;

import com.data.cache.GroupMemberCache;
import com.data.cache.GroupPlayCache;

public class GroupBean extends BaseBean{
	/**
     * name
     */
    public String name;
    public int	  owner;
    public int	  type;
    public int	  create_time;
    public int	  ban;
    public int	  gms;
    public int	  pay_type;
    public int	  stop;
    public int 	  ban_apply;
    public int		dissolve_opt;
    public int 		kick_opt;
    public boolean	ban_chat1;
    public boolean	ban_chat2;
    public int		exit_opt;
    public int option;
    public int show_num;
    public GroupMemberCache memberCache;
    
    public GroupPlayCache playCache;
    
	public void fillData(Map<String,String> map) {
		if(map.isEmpty()) {
			this.del = true;
			return;
		}
		int opt = Integer.parseInt(map.get("opt"));
		if(opt!=1) {
			this.del = true;
			return;
		}
		this.id = Integer.parseInt(map.get("id"));
		this.name = map.get("name");
		this.type = Integer.parseInt(map.get("type"));
		this.create_time = Integer.parseInt(map.get("create_time"));
		this.ban = Integer.parseInt(map.get("ban"));
		this.gms = Integer.parseInt(map.get("gms"));
		this.owner = Integer.parseInt(map.get("owner"));
		this.pay_type = Integer.parseInt(map.get("pay_type"));
		if(map.containsKey("stop")) {
			this.stop = Integer.parseInt(map.get("stop"));
		}
		if(map.containsKey("ban_apply")) {
			this.ban_apply = Integer.parseInt(map.get("ban_apply"));
		}
		kick_opt = Integer.parseInt(map.get("kick_opt"));
		dissolve_opt = Integer.parseInt(map.get("dissolve_opt"));
		if(map.containsKey("ban_chat1")) {
			this.ban_chat1 = Boolean.parseBoolean(map.get("ban_chat1"));
		}
		if(map.containsKey("ban_chat2")) {
			this.ban_chat2 = Boolean.parseBoolean(map.get("ban_chat2"));
		}
		if(map.containsKey("exit_opt")) {
			this.exit_opt = Integer.parseInt(map.get("exit_opt"));
		}
		
		if(map.containsKey("option")) {
			this.option = Integer.parseInt(map.get("option"));
		}
		
		if(map.containsKey("show_num")) {
			this.show_num = Integer.parseInt(map.get("show_num"));
		}
	}
}
