package com.qxgmat.data.dao.entity;

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

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

    /**
     * 标题
     */
    @Column(name = "`title`")
    private String title;

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

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

    /**
     * 是否试用：0非试用，1试用
     */
    @Column(name = "`is_trail`")
    private Integer isTrail;

    /**
     * 内容
     */
    @Column(name = "`content`")
    private String content;

    private static final long serialVersionUID = 1L;

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

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

    /**
     * 获取标题
     *
     * @return title - 标题
     */
    public String getTitle() {
        return title;
    }

    /**
     * 设置标题
     *
     * @param title 标题
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 获取章节
     *
     * @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非试用，1试用
     *
     * @return is_trail - 是否试用：0非试用，1试用
     */
    public Integer getIsTrail() {
        return isTrail;
    }

    /**
     * 设置是否试用：0非试用，1试用
     *
     * @param isTrail 是否试用：0非试用，1试用
     */
    public void setIsTrail(Integer isTrail) {
        this.isTrail = isTrail;
    }

    /**
     * 获取内容
     *
     * @return content - 内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 设置内容
     *
     * @param content 内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    @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(", title=").append(title);
        sb.append(", chapter=").append(chapter);
        sb.append(", part=").append(part);
        sb.append(", isTrail=").append(isTrail);
        sb.append(", content=").append(content);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private SentenceArticle obj;

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

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

        /**
         * 设置标题
         *
         * @param title 标题
         */
        public Builder title(String title) {
            obj.setTitle(title);
            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非试用，1试用
         *
         * @param isTrail 是否试用：0非试用，1试用
         */
        public Builder isTrail(Integer isTrail) {
            obj.setIsTrail(isTrail);
            return this;
        }

        /**
         * 设置内容
         *
         * @param content 内容
         */
        public Builder content(String content) {
            obj.setContent(content);
            return this;
        }

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