java.lang.Object
jakarta.ws.rs.core.CacheControl
An abstraction for the value of a HTTP Cache-Control response header.
- Since:
- 1.0
- Author:
- Paul Sandoz, Marc Hadley
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanCompares object argument to this cache control to see if they are the same considering all property values.Corresponds to a set of extension cache control directives.intCorresponds to the max-age cache control directive.Corresponds to the value of the no-cache cache control directive.Corresponds to the value of the private cache control directive.intCorresponds to the s-maxage cache control directive.inthashCode()Generate hash code from cache control properties.booleanCorresponds to the must-revalidate cache control directive.booleanCorresponds to the no-cache cache control directive.booleanCorresponds to the no-store cache control directive.booleanCorresponds to the no-transform cache control directive.booleanCorresponds to the private cache control directive.booleanCorresponds to the proxy-revalidate cache control directive.voidsetMaxAge(int maxAge) Corresponds to the max-age cache control directive.voidsetMustRevalidate(boolean mustRevalidate) Corresponds to the must-revalidate cache control directive.voidsetNoCache(boolean noCache) Corresponds to the no-cache cache control directive.voidsetNoStore(boolean noStore) Corresponds to the no-store cache control directive.voidsetNoTransform(boolean noTransform) Corresponds to the no-transform cache control directive.voidsetPrivate(boolean flag) Corresponds to the private cache control directive.voidsetProxyRevalidate(boolean proxyRevalidate) Corresponds to the must-revalidate cache control directive.voidsetSMaxAge(int smaxAge) Corresponds to the s-maxage cache control directive.toString()Deprecated.The format of the toString() method is subject to change in a future version.static CacheControlDeprecated.This method will be removed in a future version.
- 
Constructor Details- 
CacheControlpublic CacheControl()Create a new instance of CacheControl. The new instance will have the following default settings:- private = false
- noCache = false
- noStore = false
- noTransform = true
- mustRevalidate = false
- proxyRevalidate = false
- An empty list of private fields
- An empty list of no-cache fields
- An empty map of cache extensions
 
 
- 
- 
Method Details- 
valueOfDeprecated.This method will be removed in a future version. Please use RuntimeDelegate.getInstance().createHeaderDelegate(CacheControl.class).fromString(value) instead.Creates a new instance of CacheControl by parsing the supplied string.- Parameters:
- value- the cache control string
- Returns:
- the newly created CacheControl
- Throws:
- IllegalArgumentException- if the supplied string cannot be parsed or is null
 
- 
isMustRevalidatepublic boolean isMustRevalidate()Corresponds to the must-revalidate cache control directive.- Returns:
- true if the must-revalidate cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
setMustRevalidatepublic void setMustRevalidate(boolean mustRevalidate) Corresponds to the must-revalidate cache control directive.- Parameters:
- mustRevalidate- true if the must-revalidate cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
isProxyRevalidatepublic boolean isProxyRevalidate()Corresponds to the proxy-revalidate cache control directive.- Returns:
- true if the proxy-revalidate cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
setProxyRevalidatepublic void setProxyRevalidate(boolean proxyRevalidate) Corresponds to the must-revalidate cache control directive.- Parameters:
- proxyRevalidate- true if the proxy-revalidate cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
getMaxAgepublic int getMaxAge()Corresponds to the max-age cache control directive.- Returns:
- the value of the max-age cache control directive, -1 if the directive is disabled.
- See Also:
 
- 
setMaxAgepublic void setMaxAge(int maxAge) Corresponds to the max-age cache control directive.- Parameters:
- maxAge- the value of the max-age cache control directive, a value of -1 will disable the directive.
- See Also:
 
- 
getSMaxAgepublic int getSMaxAge()Corresponds to the s-maxage cache control directive.- Returns:
- the value of the s-maxage cache control directive, -1 if the directive is disabled.
- See Also:
 
- 
setSMaxAgepublic void setSMaxAge(int smaxAge) Corresponds to the s-maxage cache control directive.- Parameters:
- smaxAge- the value of the s-maxage cache control directive, a value of -1 will disable the directive.
- See Also:
 
- 
getNoCacheFieldsCorresponds to the value of the no-cache cache control directive.- Returns:
- a mutable list of field-names that will form the value of the no-cache cache control directive. An empty list results in a bare no-cache directive.
- See Also:
 
- 
setNoCachepublic void setNoCache(boolean noCache) Corresponds to the no-cache cache control directive.- Parameters:
- noCache- true if the no-cache cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
isNoCachepublic boolean isNoCache()Corresponds to the no-cache cache control directive.- Returns:
- true if the no-cache cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
isPrivatepublic boolean isPrivate()Corresponds to the private cache control directive.- Returns:
- true if the private cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
getPrivateFieldsCorresponds to the value of the private cache control directive.- Returns:
- a mutable list of field-names that will form the value of the private cache control directive. An empty list results in a bare no-cache directive.
- See Also:
 
- 
setPrivatepublic void setPrivate(boolean flag) Corresponds to the private cache control directive.- Parameters:
- flag- true if the private cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
isNoTransformpublic boolean isNoTransform()Corresponds to the no-transform cache control directive.- Returns:
- true if the no-transform cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
setNoTransformpublic void setNoTransform(boolean noTransform) Corresponds to the no-transform cache control directive.- Parameters:
- noTransform- true if the no-transform cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
isNoStorepublic boolean isNoStore()Corresponds to the no-store cache control directive.- Returns:
- true if the no-store cache control directive will be included in the response, false otherwise.
- See Also:
 
- 
setNoStorepublic void setNoStore(boolean noStore) Corresponds to the no-store cache control directive.- Parameters:
- noStore- true if the no-store cache control directive should be included in the response, false otherwise.
- See Also:
 
- 
getCacheExtensionCorresponds to a set of extension cache control directives.- Returns:
- a mutable map of cache control extension names and their values. If a key has a null value, it will appear as a bare directive. If a key has a value that contains no whitespace then the directive will appear as a simple name=value pair. If a key has a value that contains whitespace then the directive will appear as a quoted name="value" pair.
- See Also:
 
- 
toStringDeprecated.The format of the toString() method is subject to change in a future version. Please use RuntimeDelegate.getInstance().createHeaderDelegate(CacheControl.class).toString(value) instead if you rely on the format of this method.Convert the cache control to a string suitable for use as the value of the corresponding HTTP header.
- 
hashCodepublic int hashCode()Generate hash code from cache control properties.
- 
equalsCompares object argument to this cache control to see if they are the same considering all property values.
 
-