- All Superinterfaces:
HttpResponse<T>
,TrackedResponse<T>
A
TrackedResponse
that knows it may have been generated from an HTTP cache.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The status of an attempt to retrieve an HTTP response from cache.Nested classes/interfaces inherited from interface java.net.http.HttpResponse
HttpResponse.BodyHandler<T>, HttpResponse.BodyHandlers, HttpResponse.BodySubscriber<T>, HttpResponse.BodySubscribers, HttpResponse.PushPromiseHandler<T>, HttpResponse.ResponseInfo
-
Method Summary
Modifier and TypeMethodDescriptionReturns anOptional
for the response constructed from cache.Returns this response'sCacheAwareResponse.CacheStatus
.Returns anOptional
for the response received as a result of using the network.Methods inherited from interface java.net.http.HttpResponse
body, headers, previousResponse, request, sslSession, statusCode, uri, version
Methods inherited from interface com.github.mizosoft.methanol.TrackedResponse
timeRequestSent, timeResponseReceived
-
Method Details
-
networkResponse
Optional<TrackedResponse<?>> networkResponse()Returns anOptional
for the response received as a result of using the network. An empty optional is returned in case the response was entirely constructed from cache. -
cacheResponse
Optional<TrackedResponse<?>> cacheResponse()Returns anOptional
for the response constructed from cache. An empty optional is returned in case no response matching the initiating request was found in the cache. -
cacheStatus
CacheAwareResponse.CacheStatus cacheStatus()Returns this response'sCacheAwareResponse.CacheStatus
.
-