package com.yanzhenjie.andserver.sample.model;

import android.text.TextUtils;

import com.yuanxu.ecg.cmd.BindUserIdCmd;

import java.io.Serializable;

public class EcgUserInfo implements Serializable {

    private String name;//姓名
    private boolean gender;//是否为女性
    private int age;//年龄
    private int height;//身高（cm）
    private int weight;//体重（kg）

    public EcgUserInfo(String name, boolean gender, int age, int height, int weight) {
        if (TextUtils.isEmpty(name)) {
            throw new IllegalArgumentException("name is null");
        }
        if (!BindUserIdCmd.isValidNameBytesLength(name)) {
            throw new IllegalArgumentException("the length of this name(" + name + ") is greater than max byte length(" + BindUserIdCmd.MAX_NAME_BYTE_LENGTH + ")");
        }
        this.name = name;
        this.gender = gender;
        this.age = age;
        this.height = height;
        this.weight = weight;
    }

    public String getName() {
        return name == null ? "" : name;
    }

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

    public boolean getGender() {
        return gender;
    }

    public void setGender(boolean female) {
        this.gender = female;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
}
