public class CacheValue
extends java.lang.Object
implements java.io.Serializable
CacheValue represents a cached value in the
Cache.
A cached content is the content itself, a corresponding
content type and character encoding.
Additionally an expires value defining a date when the
value expires. A value of zero 0 or a negativ value
means the entry never expires.| Constructor and Description |
|---|
CacheValue() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCharacterEncoding()
Get the character encoding of the content.
|
byte[] |
getContent()
Get the cached content.
|
java.lang.String |
getContentAsString()
Convert the content into a string using the encoding.
|
java.lang.String |
getContentType()
Get the content type for the cached content.
|
long |
getExpires()
Return the expires information.
|
void |
setCharacterEncoding(java.lang.String characterEncoding)
Set the character encoding for the content.
|
void |
setContent(byte[] content)
Set the cached content.
|
void |
setContentType(java.lang.String contentType)
Set the content type for the cached content.
|
void |
setExpires(long value)
Set the expires information.
|
public java.lang.String getContentType()
public void setContentType(java.lang.String contentType)
contentType - The content type.public java.lang.String getCharacterEncoding()
nullpublic void setCharacterEncoding(java.lang.String characterEncoding)
characterEncoding - The encoding.public byte[] getContent()
public java.lang.String getContentAsString()
throws java.io.UnsupportedEncodingException
java.io.UnsupportedEncodingExceptionpublic void setContent(byte[] content)
content - The content.public void setExpires(long value)
value - The expires information.public long getExpires()