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 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RequestCacheControlprivate final longprivate final longprivate final longprivate final booleanprivate final booleanprivate final booleanprivate final long -
Constructor Summary
ConstructorsConstructorDescriptionRequestCacheControl(long maxAge, long maxStale, long minFresh, boolean noCache, boolean noStore, boolean onlyIfCached, long staleIfError) -
Method Summary
Modifier and TypeMethodDescriptionstatic RequestCacheControl.Builderbuilder()longReturns the max-age value from the Cache-Control header.longReturns the max-stale value from the Cache-Control header.longReturns the min-fresh value from the Cache-Control header.longReturns the stale-if-error value from the Cache-Control header.booleanReturns the no-cache flag from the Cache-Control header.booleanReturns the no-store flag from the Cache-Control header.booleanReturns the only-if-cached flag from the Cache-Control header.toString()
-
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
-
-
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:
getMaxAgein interfaceCacheControl- 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:
isNoCachein interfaceCacheControl- Returns:
- The no-cache flag.
-
isNoStore
public boolean isNoStore()Returns the no-store flag from the Cache-Control header.- Specified by:
isNoStorein interfaceCacheControl- 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:
getStaleIfErrorin interfaceCacheControl- Returns:
- The stale-if-error value.
-
toString
-
builder
-