org.kuali.rice.core.api.cache
Class CacheTarget

java.lang.Object
  extended by org.kuali.rice.core.api.mo.AbstractDataTransferObject
      extended by org.kuali.rice.core.api.cache.CacheTarget
All Implemented Interfaces:
Serializable, ModelObjectBasic, ModelObjectComplete

public final class CacheTarget
extends AbstractDataTransferObject

See Also:
Serialized Form

Method Summary
 boolean containsKey()
          Checks if this instance contains a key.
static CacheTarget entireCache(String cache)
          Creates an instance targeting an entire cache.
 String getCache()
          The name of the cache to target.
 String getKey()
          The key of the item in the cache to target.
static CacheTarget singleEntry(String cache, String key)
          Creates an instance targeting a single item in a cache based on the given key.
 
Methods inherited from class org.kuali.rice.core.api.mo.AbstractDataTransferObject
afterUnmarshal, beforeUnmarshal, equals, equalsExcludeFields, getDefaultHashCodeEqualsExcludeFields, hashCode, hashCodeExcludeFields, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

entireCache

public static CacheTarget entireCache(String cache)
Creates an instance targeting an entire cache.

Parameters:
cache - the name of the cache. cannot be a null or blank string
Returns:
an instance of the cache target specified
Throws:
IllegalArgumentException - if cache is null or blank

singleEntry

public static CacheTarget singleEntry(String cache,
                                      String key)
Creates an instance targeting a single item in a cache based on the given key.

Parameters:
cache - The name of the cache. cannot be a null or blank string.
key - The key of the item in the cache. cannot be a null of blank string.
Returns:
an instance of the cache target specified
Throws:
IllegalArgumentException - if the cache or key is null or blank

containsKey

public boolean containsKey()
Checks if this instance contains a key.

Returns:
true if a key exists, false otherwise

getCache

public String getCache()
The name of the cache to target. This value should never be null or blank.

Returns:
the name of the cache

getKey

public String getKey()
The key of the item in the cache to target. The key is optional on the cache target, if this target has no key then this method will return null.

Returns:
the key of this cache target, or null if a specific key is not being targeted


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.