public class CacheControl extends Object
Constructor and Description |
---|
CacheControl()
Create a new instance of CacheControl.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compares object argument to this cache control to see if they are the same
considering all property values.
|
Map<String,String> |
getCacheExtension()
Corresponds to a set of extension cache control directives.
|
int |
getMaxAge()
Corresponds to the max-age cache control directive.
|
List<String> |
getNoCacheFields()
Corresponds to the value of the no-cache cache control directive.
|
List<String> |
getPrivateFields()
Corresponds to the value of the private cache control directive.
|
int |
getSMaxAge()
Corresponds to the s-maxage cache control directive.
|
int |
hashCode()
Generate hash code from cache control properties.
|
boolean |
isMustRevalidate()
Corresponds to the must-revalidate cache control directive.
|
boolean |
isNoCache()
Corresponds to the no-cache cache control directive.
|
boolean |
isNoStore()
Corresponds to the no-store cache control directive.
|
boolean |
isNoTransform()
Corresponds to the no-transform cache control directive.
|
boolean |
isPrivate()
Corresponds to the private cache control directive.
|
boolean |
isProxyRevalidate()
Corresponds to the proxy-revalidate cache control directive.
|
void |
setMaxAge(int maxAge)
Corresponds to the max-age cache control directive.
|
void |
setMustRevalidate(boolean mustRevalidate)
Corresponds to the must-revalidate cache control directive.
|
void |
setNoCache(boolean noCache)
Corresponds to the no-cache cache control directive.
|
void |
setNoStore(boolean noStore)
Corresponds to the no-store cache control directive.
|
void |
setNoTransform(boolean noTransform)
Corresponds to the no-transform cache control directive.
|
void |
setPrivate(boolean flag)
Corresponds to the private cache control directive.
|
void |
setProxyRevalidate(boolean proxyRevalidate)
Corresponds to the must-revalidate cache control directive.
|
void |
setSMaxAge(int sMaxAge)
Corresponds to the s-maxage cache control directive.
|
String |
toString()
Convert the cache control to a string suitable for use as the value of the
corresponding HTTP header.
|
static CacheControl |
valueOf(String value)
Creates a new instance of CacheControl by parsing the supplied string.
|
public CacheControl()
public static CacheControl valueOf(String value)
value
- the cache control stringIllegalArgumentException
- if the supplied string cannot be parsed
or is nullpublic boolean isMustRevalidate()
public void setMustRevalidate(boolean mustRevalidate)
mustRevalidate
- true if the must-revalidate cache control directive should be included in the
response, false otherwise.public boolean isProxyRevalidate()
public void setProxyRevalidate(boolean proxyRevalidate)
proxyRevalidate
- true if the proxy-revalidate cache control directive should be included in the
response, false otherwise.public int getMaxAge()
public void setMaxAge(int maxAge)
maxAge
- the value of the max-age cache control directive, a value of -1 will disable the directive.public int getSMaxAge()
public void setSMaxAge(int sMaxAge)
sMaxAge
- the value of the s-maxage cache control directive, a value of -1 will disable the directive.public List<String> getNoCacheFields()
isNoCache()
,
setNoCache(boolean)
,
HTTP/1.1 section 14.9.1public void setNoCache(boolean noCache)
noCache
- true if the no-cache cache control directive should be included in the
response, false otherwise.getNoCacheFields()
,
HTTP/1.1 section 14.9.1public boolean isNoCache()
getNoCacheFields()
,
HTTP/1.1 section 14.9.1public boolean isPrivate()
getPrivateFields()
,
HTTP/1.1 section 14.9.1public List<String> getPrivateFields()
isPrivate()
,
setPrivate(boolean)
,
HTTP/1.1 section 14.9.1public void setPrivate(boolean flag)
flag
- true if the private cache control directive should be included in the
response, false otherwise.getPrivateFields()
,
HTTP/1.1 section 14.9.1public boolean isNoTransform()
public void setNoTransform(boolean noTransform)
noTransform
- true if the no-transform cache control directive should be included in the
response, false otherwise.public boolean isNoStore()
public void setNoStore(boolean noStore)
noStore
- true if the no-store cache control directive should be included in the
response, false otherwise.public Map<String,String> getCacheExtension()
public String toString()
public int hashCode()
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.