package net.northking.cctp.upperComputer.webSocket.entity;

import java.util.List;

public class ParamCheck {

    private String name; //参数名

    private String type; //类型

    private Boolean require = true; //是否需要

    private Integer max; //最大值

    private Integer min;  //最小值

    private Integer length;  //长度

    private Boolean checkSize = true; //是否大小限定

    private List<String> stringValue;  //字符串范围选择

    private List<Integer> intValue;  //数字类型范围选择

    public static ParamCheck build(){
        return new ParamCheck();
    }

    public ParamCheck name(String name){
        this.setName(name);
        return this;
    }

    public ParamCheck withMax(int max){
        this.setMax(max);
        return this;
    }

    public ParamCheck withMin(int min){
        this.setMin(min);
        return this;
    }

    public ParamCheck length(int length){
        this.setLength(length);
        return this;
    }

    public ParamCheck notRequire(){
        this.setRequire(false);
        return this;
    }

    public ParamCheck type(String type){
        this.setType(type);
        return this;
    }

    public ParamCheck rangeSelection(){
        this.setCheckSize(false);
        return this;
    }

    public ParamCheck withStringValue(List<String> value){
        this.setStringValue(value);
        return this;
    }

    public ParamCheck withIntValue(List<Integer> value){
        this.setIntValue(value);
        return this;
    }

    public String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    private void setType(String type) {
        this.type = type;
    }

    public Boolean isRequire() {
        return require;
    }

    private void setRequire(boolean require) {
        this.require = require;
    }

    public Integer getMax() {
        return max;
    }

    private void setMax(int max) {
        this.max = max;
    }

    public Integer getMin() {
        return min;
    }

    private void setMin(int min) {
        this.min = min;
    }

    public Integer getLength() {
        return length;
    }

    private void setLength(int length) {
        this.length = length;
    }

    public Boolean isCheckSize() {
        return checkSize;
    }

    private void setCheckSize(boolean checkSize) {
        this.checkSize = checkSize;
    }

    public List<String> getStringValue() {
        return stringValue;
    }

    private void setStringValue(List<String> stringValue) {
        this.stringValue = stringValue;
    }

    public List<Integer> getIntValue() {
        return intValue;
    }

    private void setIntValue(List<Integer> intValue) {
        this.intValue = intValue;
    }
}
