Package org.htmlunit
Class MockWebConnection.RawResponseData
- java.lang.Object
-
- org.htmlunit.MockWebConnection.RawResponseData
-
- Enclosing class:
- MockWebConnection
public static class MockWebConnection.RawResponseData extends java.lang.Object
Contains the raw data configured for a response.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
byteContent_
private java.nio.charset.Charset
charset_
private java.util.List<NameValuePair>
headers_
private int
statusCode_
private java.lang.String
statusMessage_
private java.lang.String
stringContent_
-
Constructor Summary
Constructors Constructor Description RawResponseData(byte[] byteContent, int statusCode, java.lang.String statusMessage, java.lang.String contentType, java.util.List<NameValuePair> headers)
RawResponseData(java.lang.String stringContent, java.nio.charset.Charset charset, int statusCode, java.lang.String statusMessage, java.lang.String contentType, java.util.List<NameValuePair> headers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) WebResponseData
asWebResponseData()
private static java.util.List<NameValuePair>
compileHeaders(java.util.List<NameValuePair> headers, java.lang.String contentType)
byte[]
getByteContent()
Gets the configured content bytes.java.nio.charset.Charset
getCharset()
Gets the configured charset.java.util.List<NameValuePair>
getHeaders()
Gets the configured headers.int
getStatusCode()
Gets the configured status code.java.lang.String
getStatusMessage()
Gets the configured status message.java.lang.String
getStringContent()
Gets the configured content String.
-
-
-
Field Detail
-
headers_
private final java.util.List<NameValuePair> headers_
-
byteContent_
private final byte[] byteContent_
-
stringContent_
private final java.lang.String stringContent_
-
statusCode_
private final int statusCode_
-
statusMessage_
private final java.lang.String statusMessage_
-
charset_
private java.nio.charset.Charset charset_
-
-
Constructor Detail
-
RawResponseData
RawResponseData(byte[] byteContent, int statusCode, java.lang.String statusMessage, java.lang.String contentType, java.util.List<NameValuePair> headers)
-
RawResponseData
RawResponseData(java.lang.String stringContent, java.nio.charset.Charset charset, int statusCode, java.lang.String statusMessage, java.lang.String contentType, java.util.List<NameValuePair> headers)
-
-
Method Detail
-
compileHeaders
private static java.util.List<NameValuePair> compileHeaders(java.util.List<NameValuePair> headers, java.lang.String contentType)
-
asWebResponseData
WebResponseData asWebResponseData()
-
getHeaders
public java.util.List<NameValuePair> getHeaders()
Gets the configured headers.- Returns:
- the headers
-
getByteContent
public byte[] getByteContent()
Gets the configured content bytes.- Returns:
null
if a String content has been configured
-
getStringContent
public java.lang.String getStringContent()
Gets the configured content String.- Returns:
null
if a byte content has been configured
-
getStatusCode
public int getStatusCode()
Gets the configured status code.- Returns:
- the status code
-
getStatusMessage
public java.lang.String getStatusMessage()
Gets the configured status message.- Returns:
- the message
-
getCharset
public java.nio.charset.Charset getCharset()
Gets the configured charset.- Returns:
null
for byte content
-
-