package com.fxy.realm;

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

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

public class CutRuleRealm extends RealmObject implements Parcelable {
    @PrimaryKey // 必须要有一个主键
    public int id ;
    public int  company_id ;
    public String  number_start;
    public int  number_length;
    public int  cut_type;
    public int  start_index;
    public int cut_length;
    public String  is_delete;
    public int create_user;
    public String  create_date;


    public CutRuleRealm() {
    }

    public int getId() {
        return id;
    }

    public int getCompanyId() {
        return company_id;
    }

    public String getNumberStart() {
        return number_start;
    }

    public int getNumberLength() {
        return number_length;
    }

    public int getCutType() {
        return cut_type;
    }

    public int getStartIndex() {
        return start_index;
    }

    public int getCutLength() {
        return cut_length;
    }

    public String getIsDelete() {
        return is_delete;
    }

    public int getCreateUser() {
        return create_user;
    }

    public String getCreateDate() {
        return create_date;
    }

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

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeInt(this.company_id);
        dest.writeString(this.number_start);
        dest.writeInt(this.number_length);
        dest.writeInt(this.cut_type);
        dest.writeInt(this.start_index);
        dest.writeInt(this.cut_length);
        dest.writeString(this.is_delete);
        dest.writeInt(this.create_user);
        dest.writeString(this.create_date);
    }

    public void readFromParcel(Parcel source) {
        this.id = source.readInt();
        this.company_id = source.readInt();
        this.number_start = source.readString();
        this.number_length = source.readInt();
        this.cut_type = source.readInt();
        this.start_index = source.readInt();
        this.cut_length = source.readInt();
        this.is_delete = source.readString();
        this.create_user = source.readInt();
        this.create_date = source.readString();
    }

    protected CutRuleRealm(Parcel in) {
        this.id = in.readInt();
        this.company_id = in.readInt();
        this.number_start = in.readString();
        this.number_length = in.readInt();
        this.cut_type = in.readInt();
        this.start_index = in.readInt();
        this.cut_length = in.readInt();
        this.is_delete = in.readString();
        this.create_user = in.readInt();
        this.create_date = in.readString();
    }

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

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