package com.sdtool.common.entity.base;

import com.sweetfish.util.Comment;

/**
 * Created by jlutt on 2018-10-22.
 *
 * @author jlutt
 */
public class ScriptContent {

    @Comment("id")
    private long id;

    @Comment("code")
    private String code;

    @Comment("脚本模块")
    private int module;

    private int commonFlag;

    private String moduleName;

    @Comment("脚本内容")
    private String scriptBody;

    public ScriptContent() {
    }

    private ScriptContent(Builder builder) {
        setId(builder.id);
        setCode(builder.code);
        setModule(builder.module);
        setCommonFlag(builder.commonFlag);
        setModuleName(builder.moduleName);
        setScriptBody(builder.scriptBody);
    }

    public static Builder newBuilder() {
        return new Builder();
    }


    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getScriptBody() {
        return scriptBody;
    }

    public void setScriptBody(String scriptBody) {
        this.scriptBody = scriptBody;
    }

    public int getModule() {
        return module;
    }

    public void setModule(int module) {
        this.module = module;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getModuleName() {
        return moduleName;
    }

    public void setModuleName(String moduleName) {
        this.moduleName = moduleName;
    }

    public int getCommonFlag() {
        return commonFlag;
    }

    public void setCommonFlag(int commonFlag) {
        this.commonFlag = commonFlag;
    }


    public static final class Builder {
        private long id;
        private String code;
        private int module;
        private int commonFlag;
        private String moduleName;
        private String scriptBody;

        private Builder() {
        }

        public Builder id(long val) {
            id = val;
            return this;
        }

        public Builder code(String val) {
            code = val;
            return this;
        }

        public Builder module(int val) {
            module = val;
            return this;
        }

        public Builder commonFlag(int val) {
            commonFlag = val;
            return this;
        }

        public Builder moduleName(String val) {
            moduleName = val;
            return this;
        }

        public Builder scriptBody(String val) {
            scriptBody = val;
            return this;
        }

        public ScriptContent build() {
            return new ScriptContent(this);
        }
    }
}
