package com.creyond.ecgdemo;

import android.os.Parcel;
import android.os.Parcelable;

public class User implements Parcelable {
    String name;
    String password;
    String phone;
    int age;
    String sex;
    int height;
    int weight;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.name);
        dest.writeString(this.password);
        dest.writeString(this.phone);
        dest.writeInt(this.age);
        dest.writeString(this.sex);
        dest.writeInt(this.height);
        dest.writeInt(this.weight);
    }

    public User() {
    }

    protected User(Parcel in) {
        this.name = in.readString();
        this.password = in.readString();
        this.phone = in.readString();
        this.age = in.readInt();
        this.sex = in.readString();
        this.height = in.readInt();
        this.weight = in.readInt();
    }

    public static final Parcelable.Creator<User> CREATOR = new Parcelable.Creator<User>() {
        @Override
        public User createFromParcel(Parcel source) {
            return new User(source);
        }

        @Override
        public User[] newArray(int size) {
            return new User[size];
        }
    };
}
