Class RequestCacheControl

java.lang.Object
org.apache.hc.client5.http.cache.RequestCacheControl
All Implemented Interfaces:
CacheControl

@Contract(threading=IMMUTABLE) public final class RequestCacheControl extends Object implements CacheControl
Represents the value of the Cache-Control header in an HTTP request containing cache control directives.
Since:
5.4
  • Field Details

    • maxAge

      private final long maxAge
    • maxStale

      private final long maxStale
    • minFresh

      private final long minFresh
    • noCache

      private final boolean noCache
    • noStore

      private final boolean noStore
    • onlyIfCached

      private final boolean onlyIfCached
    • staleIfError

      private final long staleIfError
    • DEFAULT

      public static final RequestCacheControl DEFAULT
  • Constructor Details

    • RequestCacheControl

      RequestCacheControl(long maxAge, long maxStale, long minFresh, boolean noCache, boolean noStore, boolean onlyIfCached, long staleIfError)
  • Method Details

    • getMaxAge

      public long getMaxAge()
      Returns the max-age value from the Cache-Control header.
      Specified by:
      getMaxAge in interface CacheControl
      Returns:
      The max-age value.
    • getMaxStale

      public long getMaxStale()
      Returns the max-stale value from the Cache-Control header.
      Returns:
      The max-stale value.
    • getMinFresh

      public long getMinFresh()
      Returns the min-fresh value from the Cache-Control header.
      Returns:
      The min-fresh value.
    • isNoCache

      public boolean isNoCache()
      Returns the no-cache flag from the Cache-Control header.
      Specified by:
      isNoCache in interface CacheControl
      Returns:
      The no-cache flag.
    • isNoStore

      public boolean isNoStore()
      Returns the no-store flag from the Cache-Control header.
      Specified by:
      isNoStore in interface CacheControl
      Returns:
      The no-store flag.
    • isOnlyIfCached

      public boolean isOnlyIfCached()
      Returns the only-if-cached flag from the Cache-Control header.
      Returns:
      The only-if-cached flag.
    • getStaleIfError

      public long getStaleIfError()
      Returns the stale-if-error value from the Cache-Control header.
      Specified by:
      getStaleIfError in interface CacheControl
      Returns:
      The stale-if-error value.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static RequestCacheControl.Builder builder()