001/*
002 * Stallion Core: A Modern Web Framework
003 *
004 * Copyright (C) 2015 - 2016 Stallion Software LLC.
005 *
006 * This program is free software: you can redistribute it and/or modify it under the terms of the
007 * GNU General Public License as published by the Free Software Foundation, either version 2 of
008 * the License, or (at your option) any later version. This program is distributed in the hope that
009 * it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
011 * License for more details. You should have received a copy of the GNU General Public License
012 * along with this program.  If not, see <http://www.gnu.org/licenses/gpl-2.0.html>.
013 *
014 *
015 *
016 */
017
018package io.stallion.restfulEndpoints;
019
020import java.util.regex.Pattern;
021
022
023public class RequestArg {
024    private String type = "";
025    private String name = "";
026    private Object defaultValue = null;
027    private Class annotationClass;
028    private Class targetClass = null;
029    private boolean required;
030    private Pattern validationPattern;
031    private boolean emailParam = false;
032    private int minLength = 0;
033    private boolean allowEmpty = true;
034
035
036
037
038    public Class getTargetClass() {
039        return targetClass;
040    }
041
042    public RequestArg setTargetClass(Class targetClass) {
043        this.targetClass = targetClass;
044        return this;
045    }
046
047    public String getType() {
048        return type;
049    }
050
051    public RequestArg setType(String type) {
052        this.type = type;
053        return this;
054    }
055
056    public String getName() {
057        return name;
058    }
059
060    public RequestArg setName(String name) {
061        this.name = name;
062        return this;
063    }
064
065
066    public Object getDefaultValue() {
067        return defaultValue;
068    }
069
070    public void setDefaultValue(Object defaultValue) {
071        this.defaultValue = defaultValue;
072    }
073
074
075
076    public Class getAnnotationClass() {
077        return annotationClass;
078    }
079
080    public void setAnnotationClass(Class annotationClass) {
081        this.annotationClass = annotationClass;
082    }
083
084    public boolean isRequired() {
085        return required;
086    }
087
088    public RequestArg setRequired(boolean required) {
089        this.required = required;
090        return this;
091    }
092
093    public Pattern getValidationPattern() {
094        return validationPattern;
095    }
096
097    public RequestArg setValidationPattern(Pattern validationPattern) {
098        this.validationPattern = validationPattern;
099        return this;
100    }
101
102    public boolean isEmailParam() {
103        return emailParam;
104    }
105
106    public RequestArg setEmailParam(boolean emailParam) {
107        this.emailParam = emailParam;
108        return this;
109    }
110
111    public int getMinLength() {
112        return minLength;
113    }
114
115    public RequestArg setMinLength(int minLength) {
116        this.minLength = minLength;
117        return this;
118    }
119
120    public boolean isAllowEmpty() {
121        return allowEmpty;
122    }
123
124    public RequestArg setAllowEmpty(boolean allowEmpty) {
125        this.allowEmpty = allowEmpty;
126        return this;
127    }
128}