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

com.datastax.stargate.sdk.core.ApiResponseHttp Maven / Gradle / Ivy

package com.datastax.stargate.sdk.core;

import java.util.HashMap;
import java.util.Map;

/**
 * Response HTTP.
 *
 * @author Cedrick LUNVEN (@clunven)
 */
public class ApiResponseHttp {
    
    /** JSON String. */
    private final String body;
    
    /** Http status code. */
    private final int code;
    
    /** Http Headers. **/
    private Map headers = new HashMap<>();
    
    /**
     * Defaut constructor.
     * 
     * @param body
     *      request body
     * @param code
     *      request code
     */
    public ApiResponseHttp(String body, int code) {
        this.body = body;
        this.code = code;
    }
    
    /**
     * Full constructor.
     * 
     * @param body
     *      request body
     * @param code
     *      request code
     * @param headers
     *      request headers      
     */
    public ApiResponseHttp(String body, int code, Map headers) {
        this.body = body;
        this.code = code;
        this.headers = headers;
    }

    /**
     * Getter accessor for attribute 'body'.
     *
     * @return
     *       current value of 'body'
     */
    public String getBody() {
        return body;
    }

    /**
     * Getter accessor for attribute 'code'.
     *
     * @return
     *       current value of 'code'
     */
    public int getCode() {
        return code;
    }

    /**
     * Getter accessor for attribute 'headers'.
     *
     * @return
     *       current value of 'headers'
     */
    public Map getHeaders() {
        return headers;
    }
    

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy