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

com.github.httpmock.dto.ResponseDto Maven / Gradle / Ivy

package com.github.httpmock.dto;

import static com.github.httpmock.util.CollectionUtil.emptyMap;

import java.util.Map;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

public class ResponseDto {
	private int statusCode;
	private String payload;
	private Map headers;

	public ResponseDto() {
		this.statusCode = 200;
		this.headers = emptyMap();
	}

	public int getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(int statusCode) {
		this.statusCode = statusCode;
	}

	public String getPayload() {
		return payload;
	}

	public void setPayload(String payload) {
		this.payload = payload;
	}

	public Map getHeaders() {
		return headers;
	}

	public void setHeaders(Map headers) {
		this.headers = headers;
	}

	@Override
	public boolean equals(Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

	public String getContentType() {
		return headers.get("Content-Type");
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy