org.springframework.cache.interceptor
Class DefaultCacheInvalidateDefinition

java.lang.Object
  extended by org.springframework.cache.interceptor.DefaultCacheInvalidateDefinition
All Implemented Interfaces:
CacheDefinition, CacheInvalidateDefinition

public class DefaultCacheInvalidateDefinition
extends Object
implements CacheInvalidateDefinition

Default implementation of the CacheInvalidateDefinition interface.

Author:
Costin Leau

Constructor Summary
DefaultCacheInvalidateDefinition()
           
 
Method Summary
 boolean equals(Object other)
          This implementation compares the toString() results.
 Set<String> getCacheNames()
          Returns the names of the cache against which this operation is performed.
 String getCondition()
          Returns the SpEL expression conditioning the operation.
protected  StringBuilder getDefinitionDescription()
          Return an identifying description for this caching definition.
 String getKey()
          Returns the SpEL expression identifying the cache key.
 String getName()
          Returns the name of this operation.
 int hashCode()
          This implementation returns toString()'s hash code.
 boolean isCacheWide()
          Returns whether the operation affects the entire cache or not.
 void setCacheName(String cacheName)
           
 void setCacheNames(String[] cacheNames)
           
 void setCacheWide(boolean cacheWide)
           
 void setCondition(String condition)
           
 void setKey(String key)
           
 void setName(String name)
           
 String toString()
          Return an identifying description for this cache operation definition.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.cache.interceptor.CacheDefinition
getCacheNames, getCondition, getKey, getName
 

Constructor Detail

DefaultCacheInvalidateDefinition

public DefaultCacheInvalidateDefinition()
Method Detail

isCacheWide

public boolean isCacheWide()
Description copied from interface: CacheInvalidateDefinition
Returns whether the operation affects the entire cache or not.

Specified by:
isCacheWide in interface CacheInvalidateDefinition
Returns:
whether the operation is cache wide or not.

setCacheWide

public void setCacheWide(boolean cacheWide)

getDefinitionDescription

protected StringBuilder getDefinitionDescription()
Return an identifying description for this caching definition.

Available to subclasses, for inclusion in their toString() result.


getCacheNames

public Set<String> getCacheNames()
Description copied from interface: CacheDefinition
Returns the names of the cache against which this operation is performed.

Specified by:
getCacheNames in interface CacheDefinition
Returns:
names of the cache on which the operation is performed.

getCondition

public String getCondition()
Description copied from interface: CacheDefinition
Returns the SpEL expression conditioning the operation.

Specified by:
getCondition in interface CacheDefinition
Returns:
operation condition (as SpEL expression).

getKey

public String getKey()
Description copied from interface: CacheDefinition
Returns the SpEL expression identifying the cache key.

Specified by:
getKey in interface CacheDefinition
Returns:

getName

public String getName()
Description copied from interface: CacheDefinition
Returns the name of this operation. Can be null. In case of Spring's declarative caching, the exposed name will be: fully qualified class name.method name.

Specified by:
getName in interface CacheDefinition
Returns:
the operation name

setCacheName

public void setCacheName(String cacheName)

setCacheNames

public void setCacheNames(String[] cacheNames)

setCondition

public void setCondition(String condition)

setKey

public void setKey(String key)

setName

public void setName(String name)

equals

public boolean equals(Object other)
This implementation compares the toString() results.

Overrides:
equals in class Object
See Also:
toString()

hashCode

public int hashCode()
This implementation returns toString()'s hash code.

Overrides:
hashCode in class Object
See Also:
toString()

toString

public String toString()
Return an identifying description for this cache operation definition.

Has to be overridden in subclasses for correct equals and hashCode behavior. Alternatively, equals(java.lang.Object) and hashCode() can be overridden themselves.

Overrides:
toString in class Object