package com.example.lenovo.addressbook;

/**
 * Created by lenovo on 2017/3/30.
 */

public class Person {
    private Integer id;           // 标识符
    private String name;          // 姓名
    private String phone;         // 电话
    private String email;         // 邮箱
    private String weixin;         // 微信号
    private String qq;            // QQ号
    private String organization; // 机构
    private String address;       // 地址
    private String color;        // 颜色

    public Person(){}

    public Person(String name,
                   String phone,
                   String email,
                   String weixin,
                   String qq,
                   String organization,
                   String address,
                   String color)
    {
        this.name = name;
        this.phone = phone;
        this.email = email;
        this.weixin = weixin;
        this.qq = qq;
        this.organization = organization;
        this.address = address;
        this.color = color;
    }
    public Person(Integer id,
                   String name,
                   String phone,
                   String email,
                   String weixin,
                   String qq,
                   String organization,
                   String address,
                   String color)
    {
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.email = email;
        this.weixin = weixin;
        this.qq = qq;
        this.organization = organization;
        this.address = address;
        this.color = color;
    }
    //字段枚举
    public static enum Field {
        NAME, PHONE, EMAIL, WEIXIN, QQ, ORGANIZATION, ADDRESS, COLOR
    }

    //获取字段
    public String get(Field f) {
        switch (f) {
            case COLOR:         return color;
            case PHONE:         return phone;
            case EMAIL:         return email;
            case WEIXIN:        return weixin;
            case ORGANIZATION:  return organization;
            case QQ:            return qq;
            case ADDRESS:       return address;
            case NAME:          return name;
            default:            return name;
        }
    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getWeixin() {
        return weixin;
    }

    public void setWeixin(String weixin) {
        this.weixin = weixin;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public String getOrganization() {
        return organization;
    }

    public void setOrganization(String organization) {
        this.organization = organization;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }
}
