
br.com.moip.api.request.RequestProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-java Show documentation
Show all versions of sdk-java Show documentation
Java SDK for Moip APIs integration
The newest version!
package br.com.moip.api.request;
import org.apache.http.entity.ContentType;
import java.util.Map;
public class RequestProperties {
protected String method;
protected String endpoint;
protected Map body;
protected Class type;
protected ContentType contentType;
protected String accept;
public String getMethod() { return method; }
public String getEndpoint() { return endpoint; }
public Object getObject() { return body; }
public Class getType() { return type; }
public ContentType getContentType() { return contentType; }
public String getAccept() { return accept; }
/**
* This method is used to verify if the {@code Accept} header was settled into properties.
*
* @return {@code boolean}
*/
public boolean hasAccept() {
if (this.accept == null) { return false; }
return true;
}
public boolean shouldSendBody(){
if(body != null)
return true;
return getMethod().equals("POST") || getMethod().equals("PUT") || getMethod().equals("PATCH");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy