public final class CacheDirective extends Object implements NamedValue<String>
Constructor and Description |
---|
CacheDirective(String name)
Constructor for directives with no value.
|
CacheDirective(String name,
String value)
Constructor for directives with a value.
|
CacheDirective(String name,
String value,
boolean digit)
Constructor for directives with a value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getName()
Returns the name.
|
String |
getValue()
Returns the value.
|
int |
hashCode() |
boolean |
isDigit()
Returns true if the directive contains a digit value.
|
static CacheDirective |
maxAge(int maxAge)
Creates a "max-age" directive.
|
static CacheDirective |
maxStale()
Creates a "max-stale" directive.
|
static CacheDirective |
maxStale(int maxStale)
Creates a "max-stale" directive.
|
static CacheDirective |
minFresh(int minFresh)
Creates a "min-fresh" directive.
|
static CacheDirective |
mustRevalidate()
Creates a "must-revalidate" directive.
|
static CacheDirective |
noCache()
Creates a "no-cache" directive.
|
static CacheDirective |
noCache(List<String> fieldNames)
Creates a "no-cache" directive.
|
static CacheDirective |
noCache(String fieldName)
Creates a "no-cache" directive.
|
static CacheDirective |
noStore()
Creates a "no-store" directive.
|
static CacheDirective |
noTransform()
Creates a "no-transform" directive.
|
static CacheDirective |
onlyIfCached()
Creates a "onlyIfCached" directive.
|
static CacheDirective |
privateInfo()
Creates a "private" directive.
|
static CacheDirective |
privateInfo(List<String> fieldNames)
Creates a "private" directive.
|
static CacheDirective |
privateInfo(String fieldName)
Creates a "private" directive.
|
static CacheDirective |
proxyMustRevalidate()
Creates a "proxy-revalidate" directive.
|
static CacheDirective |
publicInfo()
Creates a "public" directive.
|
void |
setDigit(boolean digit)
Indicates if the directive is a digit value.
|
void |
setName(String name)
Sets the name.
|
void |
setValue(String value)
Sets the value.
|
static CacheDirective |
sharedMaxAge(int sharedMaxAge)
Creates a "s-maxage" directive.
|
String |
toString() |
public CacheDirective(String name)
name
- The directive name.public CacheDirective(String name, String value)
name
- The directive name.value
- The directive value.public static CacheDirective maxAge(int maxAge)
maxAge
- Maximum age in seconds.public static CacheDirective maxStale()
public static CacheDirective maxStale(int maxStale)
maxStale
- Maximum stale age in seconds.public static CacheDirective minFresh(int minFresh)
minFresh
- Minimum freshness lifetime in seconds.public static CacheDirective mustRevalidate()
public static CacheDirective noCache()
public static CacheDirective noCache(List<String> fieldNames)
fieldNames
- Field names, typically a HTTP header name, that must not be
sent by caches.public static CacheDirective noCache(String fieldName)
fieldName
- A field name, typically a HTTP header name, that must not be
sent by caches.public static CacheDirective noStore()
public static CacheDirective noTransform()
public static CacheDirective onlyIfCached()
public static CacheDirective privateInfo()
public static CacheDirective privateInfo(List<String> fieldNames)
fieldNames
- Field names, typically a HTTP header name, that must be
private.public static CacheDirective privateInfo(String fieldName)
fieldName
- A field name, typically a HTTP header name, that is private.public static CacheDirective proxyMustRevalidate()
public static CacheDirective publicInfo()
public static CacheDirective sharedMaxAge(int sharedMaxAge)
sharedMaxAge
- Maximum age in seconds.public String getName()
getName
in interface NamedValue<String>
public String getValue()
getValue
in interface NamedValue<String>
public boolean isDigit()
public void setDigit(boolean digit)
digit
- True if the directive contains a digit value.public void setName(String name)
name
- The name.public void setValue(String value)
setValue
in interface NamedValue<String>
value
- The value.Copyright © 2005–2015. All rights reserved.