package cn.edu.xjau.addressbook;

/**
 * Created by Administrator on 2018/3/19 0019.
 */

public class Person {
    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(String name, String phone, String email, String organization, String qq, String weixin, String address, String color) {
        this.name = name;
        this.phone = phone;
        this.email = email;
        this.organization = organization;
        this.qq = qq;
        this.weixin = weixin;
        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 String getName() {
        return name;
    }

    public String getPhone() {
        return phone;
    }
}
