uk.co.autotrader.traverson.http.Response Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of traverson4j-core Show documentation
Show all versions of traverson4j-core Show documentation
The kernel of traverson4j. This provides the main API for a client to traverse a Hypermedia REST service
The newest version!
package uk.co.autotrader.traverson.http;
import java.net.URI;
import java.util.HashMap;
import java.util.Map;
public class Response {
private int statusCode;
private URI uri;
private T resource;
private Map responseHeaders = new HashMap();
public int getStatusCode() {
return statusCode;
}
public void setStatusCode(int statusCode) {
this.statusCode = statusCode;
}
public URI getUri() {
return uri;
}
public void setUri(URI uri) {
this.uri = uri;
}
public T getResource() {
return resource;
}
public void setResource(T resource) {
this.resource = resource;
}
public Map getResponseHeaders() {
return responseHeaders;
}
public void setResponseHeaders(Map responseHeaders) {
this.responseHeaders = responseHeaders;
}
public boolean isSuccessful() {
return statusCode / 100 == 2;
}
public void addResponseHeader(String name, String value) {
this.responseHeaders.put(name, value);
}
}