ro.isdc.wro.cache
Class CacheKey

java.lang.Object
  extended by ro.isdc.wro.cache.CacheKey
All Implemented Interfaces:
Serializable

public final class CacheKey
extends Object
implements Serializable

Used as an entry for the cache.

See Also:
Serialized Form

Constructor Summary
CacheKey(String groupName, ResourceType type, boolean minimize)
           
 
Method Summary
 CacheKey addAttribute(String key, String value)
          Add a custom key-value pair attribute.
 boolean equals(Object obj)
          
 String getGroupName()
           
 ResourceType getType()
           
 int hashCode()
          
 boolean isMinimize()
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CacheKey

public CacheKey(String groupName,
                ResourceType type,
                boolean minimize)
Parameters:
groupName - name of the group.
type - resource type (js or css)
minimize - true if the result should produce minimized version.
Method Detail

getType

public ResourceType getType()
Returns:
the type

getGroupName

public String getGroupName()
Returns:
the groupName

isMinimize

public boolean isMinimize()
Returns:
the minimize

addAttribute

public CacheKey addAttribute(String key,
                             String value)
Add a custom key-value pair attribute. Each pair is added to an internal map. The custom attributes can be used to make the key more fine grained (Ex: based on browser version or a request parameter). Both elements of the attribute (key & value) should be not null. If any of these are null, the attribute won't be added.

Parameters:
key - string representing the key of the attribute.
value - string representing the value of the attribute.
Returns:
reference to current CacheKey used for fluent interface.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2008-2013. All Rights Reserved.