org.zodiac.sdk.nio.channeling.http.HttpResponseMessage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zodiac-sdk-nio Show documentation
Show all versions of zodiac-sdk-nio Show documentation
Zodiac SDK NIO2(New Non-Blocking IO)
package org.zodiac.sdk.nio.channeling.http;
import java.util.HashMap;
import java.util.Map;
import org.zodiac.sdk.nio.http.common.HttpProtocolVersion;
public class HttpResponseMessage {
private Map headerMap = null;
private Object content=null;
private Integer code = null;
private String statusText = null;
private final String httpVersion;
/** for Streaming only **/
private boolean done = false;
public HttpResponseMessage(String httpVersion) {
this.httpVersion = httpVersion;
}
public HttpResponseMessage() {
this.httpVersion = HttpProtocolVersion.HTTP_1_1.getText();
}
public Map getHeaderMap() {
return headerMap;
}
public void setHeaderMap(Map headerMap) {
this.headerMap = headerMap;
}
public void addHeader(Map headerMap) {
if(this.headerMap == null) {
this.headerMap = headerMap;
} else {
this.headerMap.putAll(headerMap);
}
}
public void addHeader(String key, String value) {
if(this.headerMap == null) {
this.headerMap = new HashMap<>();
}
this.headerMap.put(key, value);
}
public Object getContent() {
return content;
}
public void setContent(Object content) {
this.content = content;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getStatusText() {
return statusText;
}
public void setStatusText(String statusText) {
this.statusText = statusText;
}
public String getHttpVersion() {
return httpVersion;
}
static String toResponse() {
return null;
}
public boolean isDone() {
return done;
}
public void setDone(boolean done) {
this.done = done;
}
}