public final class ClientCacheControlBuilder extends Object
ClientCacheControl using the builder pattern.
ClientCacheControl cacheControl =
ClientCacheControl.builder().noCache().build();
| Constructor and Description |
|---|
ClientCacheControlBuilder()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
ClientCacheControl |
build()
Returns a newly created
ClientCacheControl with the directives enabled so far. |
ClientCacheControlBuilder |
maxAge(Duration maxAge)
Enables or disables the
"max-age" directive. |
ClientCacheControlBuilder |
maxAgeSeconds(long maxAgeSeconds)
Enables the
"max-age" directive. |
ClientCacheControlBuilder |
maxStale()
Enables the
"max-stale directive without a value. |
ClientCacheControlBuilder |
maxStale(boolean maxStale)
Enables or disables the
"max-stale" directive. |
ClientCacheControlBuilder |
maxStale(Duration maxStale)
Enables or disables the
"max-stale" directive. |
ClientCacheControlBuilder |
maxStaleSeconds(long maxStaleSeconds)
Enables the
"max-stale" directive. |
ClientCacheControlBuilder |
minFresh(Duration minFresh)
Enables or disables the
"min-fresh" directive. |
ClientCacheControlBuilder |
minFreshSeconds(long minFreshSeconds)
Enables the
"min-fresh" directive. |
ClientCacheControlBuilder |
noCache()
Enables the
"no-cache" directive. |
ClientCacheControlBuilder |
noCache(boolean noCache)
Enables or disables the
"no-cache" directive. |
ClientCacheControlBuilder |
noStore()
Enables the
"no-store" directive. |
ClientCacheControlBuilder |
noStore(boolean noStore)
Enables or disables the
"no-store" directive. |
ClientCacheControlBuilder |
noTransform()
Enables the
"no-transform" directive. |
ClientCacheControlBuilder |
noTransform(boolean noTransform)
Enables or disables the
"no-transform" directive. |
ClientCacheControlBuilder |
onlyIfCached()
Enables the
"only-if-cached" directive. |
ClientCacheControlBuilder |
onlyIfCached(boolean onlyIfCached)
Enables or disables the
"only-if-cached" directive. |
ClientCacheControlBuilder |
staleIfError(Duration staleIfError)
Enables or disables the
"stale-if-error" directive. |
ClientCacheControlBuilder |
staleIfErrorSeconds(long staleIfErrorSeconds)
Enables the
"stale-if-error" directive. |
ClientCacheControlBuilder |
staleWhileRevalidate(Duration staleWhileRevalidate)
Enables or disables the
"stale-while-revalidate" directive. |
ClientCacheControlBuilder |
staleWhileRevalidateSeconds(long staleWhileRevalidateSeconds)
Enables the
"stale-while-revalidate" directive. |
@Deprecated public ClientCacheControlBuilder()
ClientCacheControl.builder().public ClientCacheControlBuilder onlyIfCached()
"only-if-cached" directive.public ClientCacheControlBuilder onlyIfCached(boolean onlyIfCached)
"only-if-cached" directive.onlyIfCached - true to enable or false to disable.public ClientCacheControlBuilder maxStale()
"max-stale directive without a value.public ClientCacheControlBuilder maxStale(boolean maxStale)
"max-stale" directive.maxStale - true to enable without a value or false to disable.public ClientCacheControlBuilder maxStale(Duration maxStale)
"max-stale" directive.maxStale - the value of the directive to enable, or null to disable.public ClientCacheControlBuilder maxStaleSeconds(long maxStaleSeconds)
"max-stale" directive.maxStaleSeconds - the value in seconds.public ClientCacheControlBuilder minFresh(Duration minFresh)
"min-fresh" directive.minFresh - the value of the directive to enable, or null to disable.public ClientCacheControlBuilder minFreshSeconds(long minFreshSeconds)
"min-fresh" directive.minFreshSeconds - the value in seconds.public ClientCacheControlBuilder staleWhileRevalidate(Duration staleWhileRevalidate)
"stale-while-revalidate" directive.staleWhileRevalidate - the value of the directive to enable, or null to disable.public ClientCacheControlBuilder staleWhileRevalidateSeconds(long staleWhileRevalidateSeconds)
"stale-while-revalidate" directive.staleWhileRevalidateSeconds - the value in seconds.public ClientCacheControlBuilder staleIfError(Duration staleIfError)
"stale-if-error" directive.staleIfError - the value of the directive to enable, or null to disable.public ClientCacheControlBuilder staleIfErrorSeconds(long staleIfErrorSeconds)
"stale-if-error" directive.staleIfErrorSeconds - the value in seconds.public ClientCacheControl build()
ClientCacheControl with the directives enabled so far.public ClientCacheControlBuilder noCache()
"no-cache" directive.public ClientCacheControlBuilder noCache(boolean noCache)
"no-cache" directive.noCache - true to enable or false to disable.public ClientCacheControlBuilder noStore()
"no-store" directive.public ClientCacheControlBuilder noStore(boolean noStore)
"no-store" directive.noStore - true to enable or false to disable.public ClientCacheControlBuilder noTransform()
"no-transform" directive.public ClientCacheControlBuilder noTransform(boolean noTransform)
"no-transform" directive.noTransform - true to enable or false to disable.public ClientCacheControlBuilder maxAge(Duration maxAge)
"max-age" directive.maxAge - the value of the directive to enable, or null to disable.public ClientCacheControlBuilder maxAgeSeconds(long maxAgeSeconds)
"max-age" directive.maxAgeSeconds - the value in seconds.Copyright © 2020 LeanCloud. All rights reserved.