com.github.kristofa.test.http
Class HttpRequestImpl

java.lang.Object
  extended by com.github.kristofa.test.http.HttpRequestImpl
All Implemented Interfaces:
HttpRequest

public class HttpRequestImpl
extends Object
implements HttpRequest


Constructor Summary
HttpRequestImpl()
           
HttpRequestImpl(HttpRequest request)
           
 
Method Summary
 HttpRequestImpl content(byte[] content)
          Sets content of message body for request.
 boolean equals(Object obj)
          
 byte[] getContent()
          Get content for request.
 Set<HttpMessageHeader> getHttpMessageHeaders()
          Get http message headers.
 Method getMethod()
          Gets method for request.
 String getPath()
          Gets path for request without query parameters.
 Set<QueryParameter> getQueryParameters()
          Gets query parameters for request.
 int hashCode()
          
 HttpRequestImpl httpMessageHeader(String name, String value)
          Adds a Http message header.
 HttpRequestImpl method(Method method)
          Sets method for request.
 HttpRequestImpl path(String path)
          Sets path for request.
 HttpRequestImpl queryParameter(String key, String value)
          Adds a query parameter for request.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpRequestImpl

public HttpRequestImpl()

HttpRequestImpl

public HttpRequestImpl(HttpRequest request)
Method Detail

method

public HttpRequestImpl method(Method method)
Sets method for request.

Parameters:
method - Method for request.
Returns:
This http request.

content

public HttpRequestImpl content(byte[] content)
Sets content of message body for request.

Parameters:
content - Message body for request.
Returns:
This http request.

path

public HttpRequestImpl path(String path)
Sets path for request.

Parameters:
path - Sets path for request.
Returns:
This http request.

queryParameter

public HttpRequestImpl queryParameter(String key,
                                      String value)
Adds a query parameter for request.

Parameters:
key - Parameter key. Should not be empty or null or blank.
value - Parameter value. Should not be empty or null or blank.
Returns:
This http request.

httpMessageHeader

public HttpRequestImpl httpMessageHeader(String name,
                                         String value)
Adds a Http message header.

Parameters:
name - header name. Should not be null or blank.
value - header value. Should not be null or blank.
Returns:
The http request.

getMethod

public Method getMethod()
Gets method for request.

Specified by:
getMethod in interface HttpRequest
Returns:
Method for request.

getContent

public byte[] getContent()
Get content for request.

Specified by:
getContent in interface HttpRequest
Returns:
Content for request.

getPath

public String getPath()
Gets path for request without query parameters.

Specified by:
getPath in interface HttpRequest
Returns:
Path for request.

getQueryParameters

public Set<QueryParameter> getQueryParameters()
Gets query parameters for request.

Specified by:
getQueryParameters in interface HttpRequest
Returns:
Query parameters for request.

getHttpMessageHeaders

public Set<HttpMessageHeader> getHttpMessageHeaders()
Get http message headers.

Specified by:
getHttpMessageHeaders in interface HttpRequest
Returns:
Http message headers.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2014. All Rights Reserved.