-
- All Superinterfaces:
java.net.http.HttpResponse<T>,TrackedResponse<T>
public interface CacheAwareResponse<T> extends TrackedResponse<T>
ATrackedResponsethat knows it may have been generated from an HTTP cache.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCacheAwareResponse.CacheStatusThe status of an attempt to retrieve an HTTP response from cache.-
Nested classes/interfaces inherited from interface java.net.http.HttpResponse
java.net.http.HttpResponse.BodyHandler<T extends java.lang.Object>, java.net.http.HttpResponse.BodyHandlers, java.net.http.HttpResponse.BodySubscriber<T extends java.lang.Object>, java.net.http.HttpResponse.BodySubscribers, java.net.http.HttpResponse.PushPromiseHandler<T extends java.lang.Object>, java.net.http.HttpResponse.ResponseInfo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<TrackedResponse<?>>cacheResponse()Returns anOptionalfor the response constructed from cache.CacheAwareResponse.CacheStatuscacheStatus()Returns this response'sCacheAwareResponse.CacheStatus.java.util.Optional<TrackedResponse<?>>networkResponse()Returns anOptionalfor 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 Detail
-
networkResponse
java.util.Optional<TrackedResponse<?>> networkResponse()
Returns anOptionalfor 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
java.util.Optional<TrackedResponse<?>> cacheResponse()
Returns anOptionalfor 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.
-
-