Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.kristofa.test.http;
 
HttpResponse implementation.

Author(s):
kristof
public class HttpResponseImpl implements HttpResponse {
    private final int httpCode;
    private final String contentType;
    private final byte[] content;

    
Creates a new instance.

Parameters:
httpCode http response code.
contentType Content type, can be null.
content Content, can be null.
    public HttpResponseImpl(final int httpCodefinal String contentTypefinal byte[] content) {
        this. = httpCode;
        this. = contentType;
        this. = content;
    }

    
    @Override
    public int getHttpCode() {
        return ;
    }

    
    @Override
    public String getContentType() {
        return ;
    }

    
    @Override
    public byte[] getContent() {
        return ;
    }

    
    @Override
    public String toString() {
        return "Http code: " + getHttpCode() + ", Content Type: " + (getContentType() == null ? "null" : getContentType())
            + ", Content: " + (getContent() == null ? "null" : new String(getContent()));
    }

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

    
    @Override
    public boolean equals(final Object obj) {
        return EqualsBuilder.reflectionEquals(thisobjfalse);
    }
New to GrepCode? Check out our FAQ X