public class

CacheObject

extends Object
implements Serializable
java.lang.Object
   ↳ com.atlassian.jira.util.map.CacheObject<T>

Class Overview

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.

Summary

Fields
public static final CacheObject NULL_INSTANCE A CacheObject<T> whose value is null.
Public Constructors
CacheObject(T value)
Public Methods
static <T> CacheObject<T> NULL()
Returns a CacheObject<T> whose value is null.
boolean equals(Object o)
T getValue()
boolean hasValue()
int hashCode()
boolean isNull()
String toString()
static <T> CacheObject<T> wrap(T object)
Wraps the given value in a CacheObject.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final CacheObject NULL_INSTANCE

A CacheObject<T> whose value is null. Prefer NULL() to avoid generic-related warnings.

Public Constructors

public CacheObject (T value)

Public Methods

public static CacheObject<T> NULL ()

Returns a CacheObject<T> whose value is null.

Returns
  • a CacheObject<T> whose value is null

public boolean equals (Object o)

public T getValue ()

public boolean hasValue ()

public int hashCode ()

public boolean isNull ()

public String toString ()

public static CacheObject<T> wrap (T object)

Wraps the given value in a CacheObject.

Parameters
object a <T>
Returns
  • a CacheObject that wraps the given value