接口 ResponseExtractor<T>

类型参数:
T - the data type
所有已知实现类:
HttpMessageConverterExtractor, RestTemplate.HeadersExtractor, RestTemplate.ResponseEntityResponseExtractor
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@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).

从以下版本开始:
4.0
作者:
Arjen Poutsma
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    Extract data from the given ClientHttpResponse and return it.
  • 方法详细资料

    • extractData

      @Nullable T extractData(ClientHttpResponse response) throws IOException
      Extract data from the given ClientHttpResponse and return it.
      参数:
      response - the HTTP response
      返回:
      the extracted data
      抛出:
      IOException - in case of I/O errors