public final class CacheDirective extends java.lang.Object implements NamedValue<java.lang.String>
| Constructor and Description | 
|---|
CacheDirective(java.lang.String name)
Constructor for directives with no value. 
 | 
CacheDirective(java.lang.String name,
              java.lang.String value)
Constructor for directives with a value. 
 | 
CacheDirective(java.lang.String name,
              java.lang.String value,
              boolean digit)
Constructor for directives with a value. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
equals(java.lang.Object obj) | 
java.lang.String | 
getName()
Returns the name. 
 | 
java.lang.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(java.util.List<java.lang.String> fieldNames)
Creates a "no-cache" directive. 
 | 
static CacheDirective | 
noCache(java.lang.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(java.util.List<java.lang.String> fieldNames)
Creates a "private" directive. 
 | 
static CacheDirective | 
privateInfo(java.lang.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(java.lang.String name)
Sets the name. 
 | 
void | 
setValue(java.lang.String value)
Sets the value. 
 | 
static CacheDirective | 
sharedMaxAge(int sharedMaxAge)
Creates a "s-maxage" directive. 
 | 
java.lang.String | 
toString()  | 
public CacheDirective(java.lang.String name)
name - The directive name.public CacheDirective(java.lang.String name,
                      java.lang.String value)
name - The directive name.value - The directive value.public CacheDirective(java.lang.String name,
                      java.lang.String value,
                      boolean digit)
name - The directive name.value - The directive value.digit - The kind of value (true for a digit value, false otherwise).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(java.util.List<java.lang.String> fieldNames)
fieldNames - Field names, typically a HTTP header name, that must not be
            sent by caches.public static CacheDirective noCache(java.lang.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(java.util.List<java.lang.String> fieldNames)
fieldNames - Field names, typically a HTTP header name, that must be
            private.public static CacheDirective privateInfo(java.lang.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 boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getName()
getName in interface NamedValue<java.lang.String>public java.lang.String getValue()
getValue in interface NamedValue<java.lang.String>public int hashCode()
hashCode in class java.lang.Objectpublic boolean isDigit()
public void setDigit(boolean digit)
digit - True if the directive contains a digit value.public void setName(java.lang.String name)
name - The name.public void setValue(java.lang.String value)
setValue in interface NamedValue<java.lang.String>value - The value.public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2005-2024 Restlet.