public class SingleHeaderExtractor extends java.lang.Object implements HttpResponseAccessor
This extractor assumes that the HTTP header occurs only once in the HTTP response. If it occurs multiple times, the value of only one of the instances will be returned.
Constructor and Description |
---|
SingleHeaderExtractor(java.lang.String headerName)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
access(HttpResponse response)
Processes the raw HTTP response.
|
java.lang.String |
getHeaderValue()
Returns the captured HTTP header value.
|
public SingleHeaderExtractor(java.lang.String headerName)
headerName
- name of the header to be extracted; must not be
null
.public void access(HttpResponse response)
HttpResponseAccessor
If the implementation of this method throws a RuntimeException
it will be logged and ignored, i.e. it cannot fail the response
processing.
access
in interface HttpResponseAccessor
response
- representing the raw REST/HTTP responsepublic java.lang.String getHeaderValue()