package com.qxgmat.data.dao.entity;

import java.io.Serializable;
import javax.persistence.*;

@Table(name = "user_sentence_process")
public class UserSentenceProcess implements Serializable {
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 用户id
     */
    @Column(name = "`user_id`")
    private Integer userId;

    /**
     * 章节
     */
    @Column(name = "`chapter`")
    private Integer chapter;

    /**
     * 段落
     */
    @Column(name = "`part`")
    private Integer part;

    /**
     * 进度：0-100
     */
    @Column(name = "`process`")
    private Integer process;

    private static final long serialVersionUID = 1L;

    /**
     * @return id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * 获取用户id
     *
     * @return user_id - 用户id
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 设置用户id
     *
     * @param userId 用户id
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    /**
     * 获取章节
     *
     * @return chapter - 章节
     */
    public Integer getChapter() {
        return chapter;
    }

    /**
     * 设置章节
     *
     * @param chapter 章节
     */
    public void setChapter(Integer chapter) {
        this.chapter = chapter;
    }

    /**
     * 获取段落
     *
     * @return part - 段落
     */
    public Integer getPart() {
        return part;
    }

    /**
     * 设置段落
     *
     * @param part 段落
     */
    public void setPart(Integer part) {
        this.part = part;
    }

    /**
     * 获取进度：0-100
     *
     * @return process - 进度：0-100
     */
    public Integer getProcess() {
        return process;
    }

    /**
     * 设置进度：0-100
     *
     * @param process 进度：0-100
     */
    public void setProcess(Integer process) {
        this.process = process;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", chapter=").append(chapter);
        sb.append(", part=").append(part);
        sb.append(", process=").append(process);
        sb.append("]");
        return sb.toString();
    }

    public static UserSentenceProcess.Builder builder() {
        return new UserSentenceProcess.Builder();
    }

    public static class Builder {
        private UserSentenceProcess obj;

        public Builder() {
            this.obj = new UserSentenceProcess();
        }

        /**
         * @param id
         */
        public Builder id(Integer id) {
            obj.setId(id);
            return this;
        }

        /**
         * 设置用户id
         *
         * @param userId 用户id
         */
        public Builder userId(Integer userId) {
            obj.setUserId(userId);
            return this;
        }

        /**
         * 设置章节
         *
         * @param chapter 章节
         */
        public Builder chapter(Integer chapter) {
            obj.setChapter(chapter);
            return this;
        }

        /**
         * 设置段落
         *
         * @param part 段落
         */
        public Builder part(Integer part) {
            obj.setPart(part);
            return this;
        }

        /**
         * 设置进度：0-100
         *
         * @param process 进度：0-100
         */
        public Builder process(Integer process) {
            obj.setProcess(process);
            return this;
        }

        public UserSentenceProcess build() {
            return this.obj;
        }
    }
}