@NotThreadSafe public class CacheControlBuilder extends Object implements com.helger.commons.lang.ICloneable<CacheControlBuilder>
| Constructor and Description |
|---|
CacheControlBuilder()
Constructor
|
CacheControlBuilder(CacheControlBuilder aBase)
Copy constructor
|
| Modifier and Type | Method and Description |
|---|---|
CacheControlBuilder |
addExtension(String sExtension) |
com.helger.commons.collection.impl.ICommonsList<String> |
getAllExtensions() |
String |
getAsHTTPHeaderValue() |
CacheControlBuilder |
getClone() |
Long |
getMaxAgeSeconds() |
Long |
getSharedMaxAgeSeconds() |
boolean |
hasMaxAgeSeconds() |
boolean |
hasSharedMaxAgeSeconds() |
boolean |
isMustRevalidate() |
boolean |
isNoCache() |
boolean |
isNoStore() |
boolean |
isNoTransform() |
boolean |
isPrivate() |
boolean |
isProxyRevalidate() |
boolean |
isPublic() |
CacheControlBuilder |
setMaxAge(TimeUnit eTimeUnit,
long nDuration)
Set the maximum age relative to the request time
|
CacheControlBuilder |
setMaxAgeDays(long nDays)
Set the maximum age in days relative to the request time
|
CacheControlBuilder |
setMaxAgeHours(long nHours)
Set the maximum age in hours relative to the request time
|
CacheControlBuilder |
setMaxAgeMinutes(long nMinutes)
Set the maximum age in minutes relative to the request time
|
CacheControlBuilder |
setMaxAgeSeconds(long nSeconds)
Set the maximum age in seconds relative to the request time.
|
CacheControlBuilder |
setMustRevalidate(boolean bMustRevalidate)
Set the must-revalidate value.
|
CacheControlBuilder |
setNoCache(boolean bNoCache)
Set the no-cache value.
|
CacheControlBuilder |
setNoStore(boolean bNoStore)
Set the no-store value.
|
CacheControlBuilder |
setNoTransform(boolean bNoTransform)
Set the no-transform value.
|
CacheControlBuilder |
setPrivate(boolean bPrivate)
Set the private value. allows caches that are specific to one user
(e.g., in a browser) to store the response; shared caches (e.g., in a
proxy) may not.
|
CacheControlBuilder |
setProxyRevalidate(boolean bProxyRevalidate)
Set the proxy-revalidate value.
|
CacheControlBuilder |
setPublic(boolean bPublic)
Set the public value. marks authenticated responses as cacheable;
normally, if HTTP authentication is required, responses are automatically
private.
|
CacheControlBuilder |
setSharedMaxAge(TimeUnit eTimeUnit,
long nDuration)
Set the maximum age for shared caches relative to the request time.
|
CacheControlBuilder |
setSharedMaxAgeDays(long nDays)
Set the maximum age for shared caches in days relative to the request time.
|
CacheControlBuilder |
setSharedMaxAgeHours(long nHours)
Set the maximum age for shared caches in hours relative to the request
time.
|
CacheControlBuilder |
setSharedMaxAgeMinutes(long nMinutes)
Set the maximum age for shared caches in minutes relative to the request
time.
|
CacheControlBuilder |
setSharedMaxAgeSeconds(long nSeconds)
Set the maximum age for shared caches in seconds relative to the request
time.
|
String |
toString() |
public CacheControlBuilder()
public CacheControlBuilder(@Nonnull CacheControlBuilder aBase)
aBase - The object to copy the settings from. May not be null.@Nonnull public CacheControlBuilder setMaxAge(@Nonnull TimeUnit eTimeUnit, long nDuration)
eTimeUnit - TimeUnit to usenDuration - The duration in the passed unit@Nonnull public CacheControlBuilder setMaxAgeDays(@Nonnegative long nDays)
nDays - Days to keep it@Nonnull public CacheControlBuilder setMaxAgeHours(@Nonnegative long nHours)
nHours - Hours to keep it@Nonnull public CacheControlBuilder setMaxAgeMinutes(@Nonnegative long nMinutes)
nMinutes - Minutes to keep it@Nonnull public CacheControlBuilder setMaxAgeSeconds(@Nonnegative long nSeconds)
nSeconds - Seconds to keep itpublic boolean hasMaxAgeSeconds()
@Nonnull public CacheControlBuilder setSharedMaxAge(@Nonnull TimeUnit eTimeUnit, long nDuration)
eTimeUnit - TimeUnit to usenDuration - The duration in the passed unit@Nonnull public CacheControlBuilder setSharedMaxAgeDays(@Nonnegative long nDays)
nDays - Days to keep it@Nonnull public CacheControlBuilder setSharedMaxAgeHours(@Nonnegative long nHours)
nHours - Hours to keep it@Nonnull public CacheControlBuilder setSharedMaxAgeMinutes(@Nonnegative long nMinutes)
nMinutes - Minutes to keep it@Nonnull public CacheControlBuilder setSharedMaxAgeSeconds(@Nonnegative long nSeconds)
nSeconds - Seconds to keep itpublic boolean hasSharedMaxAgeSeconds()
@Nonnull public CacheControlBuilder setPublic(boolean bPublic)
bPublic - true to enable publicpublic boolean isPublic()
@Nonnull public CacheControlBuilder setPrivate(boolean bPrivate)
bPrivate - true to enable privatepublic boolean isPrivate()
@Nonnull public CacheControlBuilder setNoCache(boolean bNoCache)
bNoCache - true to enable no-cachepublic boolean isNoCache()
@Nonnull public CacheControlBuilder setNoStore(boolean bNoStore)
bNoStore - true to enable no-storepublic boolean isNoStore()
@Nonnull public CacheControlBuilder setNoTransform(boolean bNoTransform)
bNoTransform - true to enable no-transformpublic boolean isNoTransform()
@Nonnull public CacheControlBuilder setMustRevalidate(boolean bMustRevalidate)
bMustRevalidate - true to enable must-revalidatepublic boolean isMustRevalidate()
@Nonnull public CacheControlBuilder setProxyRevalidate(boolean bProxyRevalidate)
bProxyRevalidate - true to enable proxy-revalidatepublic boolean isProxyRevalidate()
@Nonnull public CacheControlBuilder addExtension(@Nonnull @Nonempty String sExtension)
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<String> getAllExtensions()
@Nonnull public CacheControlBuilder getClone()
getClone in interface com.helger.commons.lang.ICloneable<CacheControlBuilder>Copyright © 2016–2019 Philip Helger. All rights reserved.