Interface ResponseExtractor<T>

Type Parameters:
T - the data type
All Known Implementing Classes:
HttpMessageConverterExtractor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ResponseExtractor<T>
Generic callback interface used by RestTemplate's retrieval methods. Implementations of this interface perform the actual work of extracting data from a ClientHttpResponse, but don't need to worry about exception handling or closing resources.

Used internally by the RestTemplate, but also useful for application code. There is one available factory method, see RestTemplate.responseEntityExtractor(Type).

Since:
3.0
Author:
Arjen Poutsma
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Extract data from the given ClientHttpResponse and return it.
  • Method Details

    • extractData

      @Nullable T extractData(ClientHttpResponse response) throws IOException
      Extract data from the given ClientHttpResponse and return it.
      Parameters:
      response - the HTTP response
      Returns:
      the extracted data
      Throws:
      IOException - in case of I/O errors