Module methanol

Interface CacheAwareResponse<T>

  • All Superinterfaces:
    java.net.http.HttpResponse<T>, TrackedResponse<T>

    public interface CacheAwareResponse<T>
    extends TrackedResponse<T>
    A TrackedResponse that knows it may have been generated from an HTTP cache.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  CacheAwareResponse.CacheStatus
      The 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 Detail

      • networkResponse

        java.util.Optional<TrackedResponse<?>> networkResponse()
        Returns an Optional 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

        java.util.Optional<TrackedResponse<?>> cacheResponse()
        Returns an Optional for the response constructed from cache. An empty optional is returned in case no response matching the initiating request was found in the cache.