us.careydevelopment.util.api.model.RestResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-util Show documentation
Show all versions of api-util Show documentation
Convenience methods for routine API-related tasks
The newest version!
package us.careydevelopment.util.api.model;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonInclude(Include.NON_NULL)
public class RestResponse implements IRestResponse {
private ResponseStatus responseStatus;
private T response;
@JsonIgnore
private int httpStatusCode;
@Override
public int getHttpStatusCode() {
return httpStatusCode;
}
public void setHttpStatusCode(int httpStatusCode) {
this.httpStatusCode = httpStatusCode;
}
@Override
public T getResponse() {
return response;
}
public void setResponse(T response) {
this.response = response;
}
@Override
public ResponseStatus getResponseStatus() {
return responseStatus;
}
public void setResponseStatus(ResponseStatus responseStatus) {
this.responseStatus = responseStatus;
}
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
}