package com.qxgmat.data.dao.entity;

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

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

    /**
     * 角色名称
     */
    @Column(name = "`title`")
    private String title;

    /**
     * 权限列表：json
     */
    @Column(name = "`permission_list`")
    private String[] permissionList;

    @Column(name = "`create_time`")
    private Date createTime;

    @Column(name = "`update_time`")
    private Date updateTime;

    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;
    }

    /**
     * 获取权限列表：json
     *
     * @return permission_list - 权限列表：json
     */
    public String[] getPermissionList() {
        return permissionList;
    }

    /**
     * 设置权限列表：json
     *
     * @param permissionList 权限列表：json
     */
    public void setPermissionList(String[] permissionList) {
        this.permissionList = permissionList;
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @return update_time
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * @param updateTime
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @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(", permissionList=").append(permissionList);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

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

    public static class Builder {
        private ManagerRole obj;

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

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

        /**
         * 设置角色名称
         *
         * @param title 角色名称
         */
        public Builder title(String title) {
            obj.setTitle(title);
            return this;
        }

        /**
         * 设置权限列表：json
         *
         * @param permissionList 权限列表：json
         */
        public Builder permissionList(String[] permissionList) {
            obj.setPermissionList(permissionList);
            return this;
        }

        /**
         * @param createTime
         */
        public Builder createTime(Date createTime) {
            obj.setCreateTime(createTime);
            return this;
        }

        /**
         * @param updateTime
         */
        public Builder updateTime(Date updateTime) {
            obj.setUpdateTime(updateTime);
            return this;
        }

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