Package 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 java.lang.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 Description static classRequestCacheControl.Builder
-
Field Summary
Fields Modifier and Type Field Description static RequestCacheControlDEFAULTprivate longmaxAgeprivate longmaxStaleprivate longminFreshprivate booleannoCacheprivate booleannoStoreprivate booleanonlyIfCachedprivate longstaleIfError
-
Constructor Summary
Constructors Constructor Description RequestCacheControl(long maxAge, long maxStale, long minFresh, boolean noCache, boolean noStore, boolean onlyIfCached, long staleIfError)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RequestCacheControl.Builderbuilder()longgetMaxAge()Returns the max-age value from the Cache-Control header.longgetMaxStale()Returns the max-stale value from the Cache-Control header.longgetMinFresh()Returns the min-fresh value from the Cache-Control header.longgetStaleIfError()Returns the stale-if-error value from the Cache-Control header.booleanisNoCache()Returns the no-cache flag from the Cache-Control header.booleanisNoStore()Returns the no-store flag from the Cache-Control header.booleanisOnlyIfCached()Returns the only-if-cached flag from the Cache-Control header.java.lang.StringtoString()
-
-
-
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
-
DEFAULT
public static final RequestCacheControl DEFAULT
-
-
Method Detail
-
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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static RequestCacheControl.Builder builder()
-
-