All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.butor.json.CommonRequestArgs Maven / Gradle / Ivy

Go to download

This module enables fast and easy creation of sync., async., req./resp., req./resp. stream HTTP/json services.

There is a newer version: 1.0.29
Show newest version
/*******************************************************************************
 * Copyright 2013 butor.com
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package org.butor.json;

//TODO remove Cloneable
public class CommonRequestArgs implements Cloneable {
	private String sessionId;
	private String reqId;
	private String userId;
	private String lang;

	public String getSessionId() {
		return sessionId;
	}
	public void setSessionId(String sessionId_) {
		sessionId = sessionId_;
	}
	public String getReqId() {
		return reqId;
	}
	public void setReqId(String reqId_) {
		reqId = reqId_;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId_) {
		userId = userId_;
	}
	public String getLang() {
		return lang;
	}
	public void setLang(String lang_) {
		lang = lang_;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((lang == null) ? 0 : lang.hashCode());
		result = prime * result + ((reqId == null) ? 0 : reqId.hashCode());
		result = prime * result + ((sessionId == null) ? 0 : sessionId.hashCode());
		result = prime * result + ((userId == null) ? 0 : userId.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;
		CommonRequestArgs other = (CommonRequestArgs) obj;
		if (lang == null) {
			if (other.lang != null)
				return false;
		} else if (!lang.equals(other.lang))
			return false;
		if (reqId == null) {
			if (other.reqId != null)
				return false;
		} else if (!reqId.equals(other.reqId))
			return false;
		if (sessionId == null) {
			if (other.sessionId != null)
				return false;
		} else if (!sessionId.equals(other.sessionId))
			return false;
		if (userId == null) {
			if (other.userId != null)
				return false;
		} else if (!userId.equals(other.userId))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return String.format("CommonRequestArgs [sessionId=%s, reqId=%s, userId=%s, lang=%s]", sessionId, reqId,
				userId, lang);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy