java.lang.Object
io.avaje.http.client.JacksonBodyAdapter
- All Implemented Interfaces:
- BodyAdapter
Jackson BodyAdapter to read and write beans as JSON.
 
   HttpClient.builder()
       .baseUrl(baseUrl)
       .bodyAdapter(new JacksonBodyAdapter())
       .build();
 - 
Constructor SummaryConstructorsConstructorDescriptionCreate with a ObjectMapper that allows unknown properties and inclusion non empty.JacksonBodyAdapter(com.fasterxml.jackson.databind.ObjectMapper mapper) Create passing the ObjectMapper to use.
- 
Method SummaryModifier and TypeMethodDescription<T> BodyReader<T> beanReader(Class<T> cls) Return a BodyReader to read response content and convert to a bean.<T> BodyWriter<T> beanWriter(Class<?> cls) Return a BodyWriter to write beans of this type as request content.<T> BodyReader<List<T>> listReader(Class<T> cls) Return a BodyReader to read response content and convert to a list of beans.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.avaje.http.client.BodyAdapterbeanReader, beanWriter, listReader
- 
Constructor Details- 
JacksonBodyAdapterpublic JacksonBodyAdapter(com.fasterxml.jackson.databind.ObjectMapper mapper) Create passing the ObjectMapper to use.
- 
JacksonBodyAdapterpublic JacksonBodyAdapter()Create with a ObjectMapper that allows unknown properties and inclusion non empty.
 
- 
- 
Method Details- 
beanWriterDescription copied from interface:BodyAdapterReturn a BodyWriter to write beans of this type as request content.- Specified by:
- beanWriterin interface- BodyAdapter
- Parameters:
- cls- The type of the bean this writer is for
 
- 
beanReaderDescription copied from interface:BodyAdapterReturn a BodyReader to read response content and convert to a bean.- Specified by:
- beanReaderin interface- BodyAdapter
- Parameters:
- cls- The bean type to convert the content to.
 
- 
listReaderDescription copied from interface:BodyAdapterReturn a BodyReader to read response content and convert to a list of beans.- Specified by:
- listReaderin interface- BodyAdapter
- Parameters:
- cls- The bean type to convert the content to.
 
 
-