Package com.linecorp.armeria.common
Class CacheControl
java.lang.Object
com.linecorp.armeria.common.CacheControl
- Direct Known Subclasses:
ClientCacheControl
,ServerCacheControl
Directives for HTTP caching mechanisms in requests or responses. Use
ServerCacheControl
for
response-side and ClientCacheControl
for request-side.- See Also:
-
CacheControlBuilder
- Cache-Control (MDN)
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
Encodes the directives in thisCacheControl
into an HTTP"cache-control"
header value.boolean
int
hashCode()
boolean
isEmpty()
Returnstrue
if all directives are disabled.final long
Returns the value of the"max-age"
directive or-1
if disabled.final boolean
noCache()
Returns whether the"no-cache"
directive is enabled.final boolean
noStore()
Returns whether the"no-store"
directive is enabled.final boolean
Returns whether the"no-transform"
directive is enabled.abstract com.linecorp.armeria.common.CacheControlBuilder
Returns a newly createdCacheControlBuilder
which has the same initial directives with thisCacheControl
.toString()
-
Method Details
-
isEmpty
public boolean isEmpty()Returnstrue
if all directives are disabled. -
noCache
public final boolean noCache()Returns whether the"no-cache"
directive is enabled. -
noStore
public final boolean noStore()Returns whether the"no-store"
directive is enabled. -
noTransform
public final boolean noTransform()Returns whether the"no-transform"
directive is enabled. -
maxAgeSeconds
public final long maxAgeSeconds()Returns the value of the"max-age"
directive or-1
if disabled. -
toBuilder
public abstract com.linecorp.armeria.common.CacheControlBuilder toBuilder()Returns a newly createdCacheControlBuilder
which has the same initial directives with thisCacheControl
. -
asHeaderValue
Encodes the directives in thisCacheControl
into an HTTP"cache-control"
header value.- Returns:
- the
"cache-control"
header value, or an empty string if no directives were enabled.
-
equals
-
hashCode
public int hashCode() -
toString
-