com.atlassian.bamboo.util
Class NullAwareCache<K,V>

java.lang.Object
  extended by com.atlassian.bamboo.util.NullAwareCache<K,V>
Type Parameters:
K -
V -
All Implemented Interfaces:
com.google.common.base.Function<K,V>, com.google.common.cache.Cache<K,V>

public class NullAwareCache<K,V>
extends java.lang.Object
implements com.google.common.cache.Cache<K,V>

This class provides a Guava-compatible cache capable of storing null values. In general, it should not be used unless for backward compatibility reasons.


Constructor Summary
NullAwareCache(com.google.common.cache.Cache<K,com.atlassian.fugue.Option<V>> cache)
           
 
Method Summary
 V apply(K key)
           
 java.util.concurrent.ConcurrentMap<K,V> asMap()
           
 void cleanUp()
           
 boolean equals(java.lang.Object object)
           
 V get(K key)
           
 V getUnchecked(K key)
           
 void invalidate(java.lang.Object key)
           
 void invalidateAll()
           
 long size()
           
 com.google.common.cache.CacheStats stats()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAwareCache

public NullAwareCache(com.google.common.cache.Cache<K,com.atlassian.fugue.Option<V>> cache)
Method Detail

get

@Nullable
public V get(K key)
      throws java.util.concurrent.ExecutionException
Specified by:
get in interface com.google.common.cache.Cache<K,V>
Throws:
java.util.concurrent.ExecutionException

getUnchecked

@Nullable
public V getUnchecked(K key)
Specified by:
getUnchecked in interface com.google.common.cache.Cache<K,V>

apply

@Nullable
public V apply(K key)
Specified by:
apply in interface com.google.common.base.Function<K,V>
Specified by:
apply in interface com.google.common.cache.Cache<K,V>

invalidate

public void invalidate(java.lang.Object key)
Specified by:
invalidate in interface com.google.common.cache.Cache<K,V>

invalidateAll

public void invalidateAll()
Specified by:
invalidateAll in interface com.google.common.cache.Cache<K,V>

size

public long size()
Specified by:
size in interface com.google.common.cache.Cache<K,V>

stats

public com.google.common.cache.CacheStats stats()
Specified by:
stats in interface com.google.common.cache.Cache<K,V>

asMap

public java.util.concurrent.ConcurrentMap<K,V> asMap()
Specified by:
asMap in interface com.google.common.cache.Cache<K,V>

cleanUp

public void cleanUp()
Specified by:
cleanUp in interface com.google.common.cache.Cache<K,V>

equals

public boolean equals(@Nullable
                      java.lang.Object object)
Specified by:
equals in interface com.google.common.base.Function<K,V>
Overrides:
equals in class java.lang.Object


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.