de.captaingoldfish.scim.sdk.client.http.HttpResponse Maven / Gradle / Ivy
// Generated by delombok at Sat Oct 07 17:30:34 CEST 2023
package de.captaingoldfish.scim.sdk.client.http;
import java.util.Map;
/**
* author Pascal Knueppel
* created at: 09.12.2019 - 20:39
*
* represents a response object that will be returned by the {@link ScimHttpClient} if a response from a
* server was received
*/
public class HttpResponse
{
/**
* the status code of the response
*/
private int httpStatusCode;
/**
* the body of the response
*/
private String responseBody;
/**
* the headers of the response
*/
private Map responseHeaders;
@java.lang.SuppressWarnings("all")
HttpResponse(final int httpStatusCode, final String responseBody, final Map responseHeaders)
{
this.httpStatusCode = httpStatusCode;
this.responseBody = responseBody;
this.responseHeaders = responseHeaders;
}
@java.lang.SuppressWarnings("all")
public static class HttpResponseBuilder
{
@java.lang.SuppressWarnings("all")
private int httpStatusCode;
@java.lang.SuppressWarnings("all")
private String responseBody;
@java.lang.SuppressWarnings("all")
private Map responseHeaders;
@java.lang.SuppressWarnings("all")
HttpResponseBuilder()
{}
/**
* the status code of the response
*
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public HttpResponse.HttpResponseBuilder httpStatusCode(final int httpStatusCode)
{
this.httpStatusCode = httpStatusCode;
return this;
}
/**
* the body of the response
*
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public HttpResponse.HttpResponseBuilder responseBody(final String responseBody)
{
this.responseBody = responseBody;
return this;
}
/**
* the headers of the response
*
* @return {@code this}.
*/
@java.lang.SuppressWarnings("all")
public HttpResponse.HttpResponseBuilder responseHeaders(final Map responseHeaders)
{
this.responseHeaders = responseHeaders;
return this;
}
@java.lang.SuppressWarnings("all")
public HttpResponse build()
{
return new HttpResponse(this.httpStatusCode, this.responseBody, this.responseHeaders);
}
@java.lang.Override
@java.lang.SuppressWarnings("all")
public java.lang.String toString()
{
return "HttpResponse.HttpResponseBuilder(httpStatusCode=" + this.httpStatusCode + ", responseBody="
+ this.responseBody + ", responseHeaders=" + this.responseHeaders + ")";
}
}
@java.lang.SuppressWarnings("all")
public static HttpResponse.HttpResponseBuilder builder()
{
return new HttpResponse.HttpResponseBuilder();
}
/**
* the status code of the response
*/
@java.lang.SuppressWarnings("all")
public int getHttpStatusCode()
{
return this.httpStatusCode;
}
/**
* the body of the response
*/
@java.lang.SuppressWarnings("all")
public String getResponseBody()
{
return this.responseBody;
}
/**
* the headers of the response
*/
@java.lang.SuppressWarnings("all")
public Map getResponseHeaders()
{
return this.responseHeaders;
}
}