Package com.atlassian.jira.util.map
Class CacheObject<T>
java.lang.Object
com.atlassian.jira.util.map.CacheObject<T>
- All Implemented Interfaces:
Serializable
Used for keys or values in Maps that do not support null keys, or in caches
where it is needed to differentiate between a cached 'null' value and an
object not being in the cache.
Although this class is marked as being Serializable, instances will only truly be thus if the value they wrap is itself Serializable (or null).
Copyright (c) 2002-2004 All rights reserved.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetValue()inthashCode()booleanhasValue()booleanisNull()static <T> CacheObject<T>NULL()Returns a CacheObject<T> whose value is null.toString()static <T> CacheObject<T>wrap(T object) Wraps the given value in a CacheObject.
-
Field Details
-
NULL_INSTANCE
A CacheObject<T> whose value is null. PreferNULL()to avoid generic-related warnings.
-
-
Constructor Details
-
CacheObject
-
-
Method Details
-
NULL
Returns a CacheObject<T> whose value is null.- Returns:
- a CacheObject<T> whose value is null
-
wrap
Wraps the given value in a CacheObject.- Parameters:
object- a <T>- Returns:
- a CacheObject that wraps the given value
-
getValue
-
hasValue
public boolean hasValue() -
isNull
public boolean isNull() -
equals
-
hashCode
public int hashCode() -
toString
-