Class RequestCacheControl

  • All Implemented Interfaces:
    CacheControl

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

      • 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
    • Constructor Detail

      • RequestCacheControl

        RequestCacheControl​(long maxAge,
                            long maxStale,
                            long minFresh,
                            boolean noCache,
                            boolean noStore,
                            boolean onlyIfCached,
                            long staleIfError)
    • 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object