/*
* JSmart Framework - Java Web Development Framework
* Copyright (c) 2015, Jeferson Albino da Silva, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jsmartframework.web.json;
import java.util.ArrayList;
import java.util.List;
public final class Ajax {
private String id;
private String form;
private String tag;
private Integer timeout;
private Integer requestTimeout;
private String method;
private String action;
private String url;
private List<Param> params = new ArrayList<Param>(2);
private List<Param> args = new ArrayList<Param>(2);
private String update;
private String before;
private String success;
private String error;
private String complete;
private boolean validate;
private String filter;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getForm() {
return form;
}
public void setForm(String form) {
this.form = form;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public Integer getTimeout() {
return timeout;
}
public void setTimeout(Integer timeout) {
this.timeout = timeout;
}
public Integer getRequestTimeout() {
return requestTimeout;
}
public void setRequestTimeout(Integer requestTimeout) {
this.requestTimeout = requestTimeout;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public List<Param> getParams() {
return params;
}
public void addParam(Param param) {
this.params.add(param);
}
public void setParams(List<Param> params) {
this.params = params;
}
public List<Param> getArgs() {
return args;
}
public void addArg(Param arg) {
this.args.add(arg);
}
public void setArgs(List<Param> args) {
this.args = args;
}
public String getUpdate() {
return update;
}
public void setUpdate(String update) {
this.update = update;
}
public String getBefore() {
return before;
}
public void setBefore(String before) {
this.before = before;
}
public String getSuccess() {
return success;
}
public void setSuccess(String success) {
this.success = success;
}
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
public String getComplete() {
return complete;
}
public void setComplete(String complete) {
this.complete = complete;
}
public boolean isValidate() {
return validate;
}
public void setValidate(boolean validate) {
this.validate = validate;
}
public String getFilter() {
return filter;
}
public void setFilter(String filter) {
this.filter = filter;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((action == null) ? 0 : action.hashCode());
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((url == null) ? 0 : url.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Ajax other = (Ajax) obj;
if (action == null) {
if (other.action != null) {
return false;
}
} else if (!action.equals(other.action)) {
return false;
}
if (id == null) {
if (other.id != null) {
return false;
}
} else if (!id.equals(other.id)) {
return false;
}
if (url == null) {
if (other.url != null) {
return false;
}
} else if (!url.equals(other.url)) {
return false;
}
return true;
}
}