org.ektorp.http
Class JacksonableEntity
java.lang.Object
org.apache.http.entity.AbstractHttpEntity
org.ektorp.http.JacksonableEntity
- All Implemented Interfaces:
- org.apache.http.HttpEntity
@NotThreadSafe
public class JacksonableEntity
- extends org.apache.http.entity.AbstractHttpEntity
A streamed entity that obtains its content from an Object.
The content obtained from the Object instance can
optionally be buffered in a byte array in order to make the
entity self-contained and repeatable.
- See Also:
SerializableEntity
| Fields inherited from class org.apache.http.entity.AbstractHttpEntity |
chunked, contentEncoding, contentType, OUTPUT_BUFFER_SIZE |
|
Constructor Summary |
JacksonableEntity(Object ser,
boolean bufferize,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Creates new instance of this class. |
JacksonableEntity(Object ser,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
|
| Methods inherited from class org.apache.http.entity.AbstractHttpEntity |
consumeContent, getContentEncoding, getContentType, isChunked, setChunked, setContentEncoding, setContentEncoding, setContentType, setContentType |
JacksonableEntity
public JacksonableEntity(Object ser,
boolean bufferize,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
- Creates new instance of this class.
- Parameters:
ser - inputbufferize - tells whether the content should be
stored in an internal buffer
- Throws:
IOException - in case of an I/O error
JacksonableEntity
public JacksonableEntity(Object ser,
com.fasterxml.jackson.databind.ObjectMapper objectMapper)
equals
public boolean equals(Object o)
- Overrides:
equals in class Object
getContent
public InputStream getContent()
throws IOException,
IllegalStateException
- Throws:
IOException
IllegalStateException
getContentLength
public long getContentLength()
isRepeatable
public boolean isRepeatable()
isStreaming
public boolean isStreaming()
writeTo
public void writeTo(OutputStream outstream)
throws IOException
- Throws:
IOException
getTarget
public Object getTarget()
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
Copyright © 2017. All rights reserved.