Package com.linecorp.armeria.common
Class ClientCacheControlBuilder
java.lang.Object
com.linecorp.armeria.common.ClientCacheControlBuilder
public final class ClientCacheControlBuilder extends Object
Creates a new
ClientCacheControl
using the builder pattern.
ClientCacheControl cacheControl =
ClientCacheControl.builder().noCache().build();
-
Method Summary
Modifier and Type Method Description ClientCacheControl
build()
Returns a newly createdClientCacheControl
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.
-
Method Details
-
onlyIfCached
Enables the"only-if-cached"
directive. -
onlyIfCached
Enables or disables the"only-if-cached"
directive.- Parameters:
onlyIfCached
-true
to enable orfalse
to disable.
-
maxStale
Enables the"max-stale
directive without a value. -
maxStale
Enables or disables the"max-stale"
directive.- Parameters:
maxStale
-true
to enable without a value orfalse
to disable.
-
maxStale
Enables or disables the"max-stale"
directive.- Parameters:
maxStale
- the value of the directive to enable, ornull
to disable.
-
maxStaleSeconds
Enables the"max-stale"
directive.- Parameters:
maxStaleSeconds
- the value in seconds.
-
minFresh
Enables or disables the"min-fresh"
directive.- Parameters:
minFresh
- the value of the directive to enable, ornull
to disable.
-
minFreshSeconds
Enables the"min-fresh"
directive.- Parameters:
minFreshSeconds
- the value in seconds.
-
staleWhileRevalidate
Enables or disables the"stale-while-revalidate"
directive.- Parameters:
staleWhileRevalidate
- the value of the directive to enable, ornull
to disable.
-
staleWhileRevalidateSeconds
Enables the"stale-while-revalidate"
directive.- Parameters:
staleWhileRevalidateSeconds
- the value in seconds.
-
staleIfError
Enables or disables the"stale-if-error"
directive.- Parameters:
staleIfError
- the value of the directive to enable, ornull
to disable.
-
staleIfErrorSeconds
Enables the"stale-if-error"
directive.- Parameters:
staleIfErrorSeconds
- the value in seconds.
-
build
Returns a newly createdClientCacheControl
with the directives enabled so far. -
noCache
Enables the"no-cache"
directive. -
noCache
Enables or disables the"no-cache"
directive.- Parameters:
noCache
-true
to enable orfalse
to disable.
-
noStore
Enables the"no-store"
directive. -
noStore
Enables or disables the"no-store"
directive.- Parameters:
noStore
-true
to enable orfalse
to disable.
-
noTransform
Enables the"no-transform"
directive. -
noTransform
Enables or disables the"no-transform"
directive.- Parameters:
noTransform
-true
to enable orfalse
to disable.
-
maxAge
Enables or disables the"max-age"
directive.- Parameters:
maxAge
- the value of the directive to enable, ornull
to disable.
-
maxAgeSeconds
Enables the"max-age"
directive.- Parameters:
maxAgeSeconds
- the value in seconds.
-