org.apache.hc.client5.http.cache

## 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

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `RequestCacheControl.Builder`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static RequestCacheControl` | `DEFAULT`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RequestCacheControl.Builder` | `builder()`
    `long` | `getMaxAge()` Returns the max-age value from the Cache-Control header.
    `long` | `getMaxStale()` Returns the max-stale value from the Cache-Control header.
    `long` | `getMinFresh()` Returns the min-fresh value from the Cache-Control header.
    `long` | `getStaleIfError()` Returns the stale-if-error value from the Cache-Control header.
    `boolean` | `isNoCache()` Returns the no-cache flag from the Cache-Control header.
    `boolean` | `isNoStore()` Returns the no-store flag from the Cache-Control header.
    `boolean` | `isOnlyIfCached()` Returns the only-if-cached flag from the Cache-Control header.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT

          public static final RequestCacheControl DEFAULT

  - ### Method Detail

    - #### 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()

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.