Interface BodyAdapter

All Known Implementing Classes:
JacksonBodyAdapter, JsonbBodyAdapter

public interface BodyAdapter
Adaptor between beans and content of a request or response.

Typically converts between beans as JSON content.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> BodyReader<T>
    beanReader(Class<T> type)
    Return a BodyReader to read response content and convert to a bean.
    default <T> BodyReader<T>
    Return a BodyReader to read response content and convert to a bean.
    <T> BodyWriter<T>
    beanWriter(Class<?> type)
    Return a BodyWriter to write beans of this type as request content.
    default <T> BodyWriter<T>
    Return a BodyWriter to write beans of this type as request content.
    <T> BodyReader<List<T>>
    listReader(Class<T> type)
    Return a BodyReader to read response content and convert to a list of beans.
    default <T> BodyReader<List<T>>
    Return a BodyReader to read response content and convert to a list of beans.
  • Method Details

    • beanWriter

      <T> BodyWriter<T> beanWriter(Class<?> type)
      Return a BodyWriter to write beans of this type as request content.
      Parameters:
      type - The type of the bean this writer is for
    • beanWriter

      default <T> BodyWriter<T> beanWriter(Type type)
      Return a BodyWriter to write beans of this type as request content.
      Parameters:
      type - The type of the bean this writer is for
    • beanReader

      <T> BodyReader<T> beanReader(Class<T> type)
      Return a BodyReader to read response content and convert to a bean.
      Parameters:
      type - The bean type to convert the content to.
    • beanReader

      default <T> BodyReader<T> beanReader(Type type)
      Return a BodyReader to read response content and convert to a bean.
      Parameters:
      type - The bean type to convert the content to.
    • listReader

      <T> BodyReader<List<T>> listReader(Class<T> type)
      Return a BodyReader to read response content and convert to a list of beans.
      Parameters:
      type - The bean type to convert the content to.
    • listReader

      default <T> BodyReader<List<T>> listReader(Type type)
      Return a BodyReader to read response content and convert to a list of beans.
      Parameters:
      type - The bean type to convert the content to.