com.day.cq.portlet.cache
Class CacheValue

java.lang.Object
  extended by com.day.cq.portlet.cache.CacheValue
All Implemented Interfaces:
Serializable

public class CacheValue
extends Object
implements Serializable

The 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.

See Also:
Serialized Form

Constructor Summary
CacheValue()
           
 
Method Summary
 String getCharacterEncoding()
          Get the character encoding of the content.
 byte[] getContent()
          Get the cached content.
 String getContentAsString()
          Convert the content into a string using the encoding.
 String getContentType()
          Get the content type for the cached content.
 long getExpires()
          Return the expires information.
 void setCharacterEncoding(String characterEncoding)
          Set the character encoding for the content.
 void setContent(byte[] content)
          Set the cached content.
 void setContentType(String contentType)
          Set the content type for the cached content.
 void setExpires(long value)
          Set the expires information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheValue

public CacheValue()
Method Detail

getContentType

public String getContentType()
Get the content type for the cached content.

Returns:
The content type

setContentType

public void setContentType(String contentType)
Set the content type for the cached content.

Parameters:
contentType - The content type.

getCharacterEncoding

public String getCharacterEncoding()
Get the character encoding of the content.

Returns:
The character encoding or null

setCharacterEncoding

public void setCharacterEncoding(String characterEncoding)
Set the character encoding for the content.

Parameters:
characterEncoding - The encoding.

getContent

public byte[] getContent()
Get the cached content.

Returns:
The cached content.

getContentAsString

public String getContentAsString()
                          throws UnsupportedEncodingException
Convert the content into a string using the encoding.

Returns:
The content as a string
Throws:
UnsupportedEncodingException
Since:
5.4

setContent

public void setContent(byte[] content)
Set the cached content.

Parameters:
content - The content.

setExpires

public void setExpires(long value)
Set the expires information.

Parameters:
value - The expires information.

getExpires

public long getExpires()
Return the expires information.

Returns:
The expires information.


Copyright © 2011-2013 Adobe Systems Incorporated. All Rights Reserved.