接口 ResponseExtractor<T>
- 类型参数:
T
- the data type
- 所有已知实现类:
HttpMessageConverterExtractor
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
@FunctionalInterface public interface ResponseExtractor<T>
Generic callback interface used byRestTemplate
's retrieval methods Implementations of this interface perform the actual work of extracting data from aClientHttpResponse
, 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, seeRestTemplate.responseEntityExtractor(Type)
.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 T
extractData(ClientHttpResponse response)
Extract data from the givenClientHttpResponse
and return it.
方法详细资料
extractData
@Nullable T extractData(ClientHttpResponse response) throws IOException
Extract data from the givenClientHttpResponse
and return it.- 参数:
response
- the HTTP response- 返回:
- the extracted data
- 抛出:
IOException
- in case of I/O errors