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

com.ovh.ws.jsonizer.api.request.ObjectRequest Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2012, OVH. All rights reserved.
 *
 * 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 com.ovh.ws.jsonizer.api.request;

import java.lang.reflect.Type;
import java.util.Map;

import com.ovh.ws.jsonizer.api.RestService;
import com.ovh.ws.jsonizer.api.base.OvhObject;

public class ObjectRequest extends RestRequest {

	private final Map params;

	public ObjectRequest(RestService restService, String method, Type responseType, Map params) {
		super(restService, method, responseType);
		this.params = params;
	}

	@Override
	public Map getParams() {
		return params;
	}

	@Override
	public String toString() {
		return OvhObject.toStringHelper(this).add("uri", toUri()).add("params", params).toString();
	}

	@Override
	public int hashCode() {
		return OvhObject.hashCode(toUri(), params);
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj instanceof ObjectRequest) {
			ObjectRequest other = (ObjectRequest) obj;
			return OvhObject.equal(other.toUri(), toUri()) && OvhObject.equal(other.params, params);
		}
		return false;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy