public final class ServerCacheControl extends CacheControl
| Modifier and Type | Field and Description |
|---|---|
static ServerCacheControl |
DISABLED
"no-cache, no-store, must-revalidate". |
static ServerCacheControl |
EMPTY
An empty instance with all directives disabled.
|
static ServerCacheControl |
IMMUTABLE
"max-age=31536000, public, immutable". |
static ServerCacheControl |
REVALIDATED
"no-cache, must-revalidate". |
| Modifier and Type | Method and Description |
|---|---|
String |
asHeaderValue()
Encodes the directives in this
CacheControl into an HTTP "cache-control" header value. |
static ServerCacheControlBuilder |
builder()
Returns a newly created
ServerCacheControlBuilder with all directives disabled initially. |
boolean |
cachePrivate()
Returns whether the
"private" directive is enabled. |
boolean |
cachePublic()
Returns whether the
"public" directive is enabled. |
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
immutable()
Returns whether the
"immutable" directive is enabled. |
boolean |
isEmpty()
Returns
true if all directives are disabled. |
boolean |
mustRevalidate()
Returns whether the
"must-revalidate" directive is enabled. |
static ServerCacheControl |
parse(Iterable<String> directives)
Parses the specified
"cache-control" header values into a ServerCacheControl. |
static ServerCacheControl |
parse(String... directives)
Parses the specified
"cache-control" header values into a ServerCacheControl. |
boolean |
proxyRevalidate()
Returns whether the
"proxy-revalidate" directive is enabled. |
long |
sMaxAgeSeconds()
Returns the value of the
"s-maxage" directive or -1 if disabled. |
ServerCacheControlBuilder |
toBuilder()
Returns a newly created
ServerCacheControlBuilder which has the same initial directives with
this ServerCacheControl. |
maxAgeSeconds, noCache, noStore, noTransform, toStringpublic static final ServerCacheControl EMPTY
public static final ServerCacheControl DISABLED
"no-cache, no-store, must-revalidate".public static final ServerCacheControl REVALIDATED
"no-cache, must-revalidate".public static final ServerCacheControl IMMUTABLE
"max-age=31536000, public, immutable".public static ServerCacheControl parse(String... directives)
"cache-control" header values into a ServerCacheControl.
Note that any unknown directives will be ignored.ServerCacheControl decoded from the specified header values.public static ServerCacheControl parse(Iterable<String> directives)
"cache-control" header values into a ServerCacheControl.
Note that any unknown directives will be ignored.ServerCacheControl decoded from the specified header values.public static ServerCacheControlBuilder builder()
ServerCacheControlBuilder with all directives disabled initially.public boolean isEmpty()
CacheControltrue if all directives are disabled.isEmpty in class CacheControlpublic boolean cachePublic()
"public" directive is enabled.public boolean cachePrivate()
"private" directive is enabled.public boolean immutable()
"immutable" directive is enabled.public boolean mustRevalidate()
"must-revalidate" directive is enabled.public boolean proxyRevalidate()
"proxy-revalidate" directive is enabled.public long sMaxAgeSeconds()
"s-maxage" directive or -1 if disabled.public ServerCacheControlBuilder toBuilder()
ServerCacheControlBuilder which has the same initial directives with
this ServerCacheControl.toBuilder in class CacheControlpublic String asHeaderValue()
CacheControlCacheControl into an HTTP "cache-control" header value.asHeaderValue in class CacheControl"cache-control" header value, or an empty string if no directives were enabled.public boolean equals(Object o)
equals in class CacheControlpublic int hashCode()
hashCode in class CacheControlCopyright © 2020 LeanCloud. All rights reserved.