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

com.bld.commons.connection.model.ObjectRequest Maven / Gradle / Ivy

There is a newer version: 2.0.6
Show newest version
/**
 * @author Francesco Baldi
 * @mail [email protected]
 * @class com.bld.commons.connection.model.ObjectRequest.java
 */
package com.bld.commons.connection.model;

import org.springframework.http.HttpMethod;

/**
 * The Class ObjectRequest.
 *
 * @param  the generic type
 */
public class ObjectRequest extends BasicRequest{

	/**
	 * Instantiates a new object request.
	 *
	 * @param url the url
	 * @param method the method
	 */
	private ObjectRequest(String url, HttpMethod method) {
		super(url, method);
	}

	/**
	 * New instance post.
	 *
	 * @param  the generic type
	 * @param url the url
	 * @return the object request
	 */
	public static  ObjectRequest newInstancePost(String url) {
		return new ObjectRequest(url, HttpMethod.POST);
	}
	
	/**
	 * New instance put.
	 *
	 * @param  the generic type
	 * @param url the url
	 * @return the object request
	 */
	public static  ObjectRequest newInstancePut(String url) {
		return new ObjectRequest(url, HttpMethod.PUT);
	}
	
	/**
	 * New instance patch.
	 *
	 * @param  the generic type
	 * @param url the url
	 * @return the object request
	 */
	public static  ObjectRequest newInstancePatch(String url) {
		return new ObjectRequest(url, HttpMethod.PATCH);
	}
	
	/**
	 * Sets the data.
	 *
	 * @param data the new data
	 */
	public void setData(T data) {
		this.data=data;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy