All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.sdk.nio.channeling.http.HttpResponseMessage Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy