com.atlassian.jira.util.cache
Class GenericCompositeKeyCache<K,L,V>

java.lang.Object
  extended by com.atlassian.jira.util.cache.GenericCompositeKeyCache<K,L,V>
Type Parameters:
K - type of first element of the key
L - type of second element of the key
V - type of cached values

@ThreadSafe
public final class GenericCompositeKeyCache<K,L,V>
extends java.lang.Object

A simple, unbounded, pluggable cache with composite keys.

Since:
v4.2

Constructor Summary
GenericCompositeKeyCache(Function<Pair<K,L>,V> valueRetriever)
           
 
Method Summary
 V get(K first, L second)
           
static
<M,N,W> GenericCompositeKeyCache<M,N,W>
newCache(Function<Pair<M,N>,W> valueRetriever)
          Static factory method for convenient instantiation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericCompositeKeyCache

public GenericCompositeKeyCache(Function<Pair<K,L>,V> valueRetriever)
Method Detail

newCache

public static <M,N,W> GenericCompositeKeyCache<M,N,W> newCache(Function<Pair<M,N>,W> valueRetriever)
Static factory method for convenient instantiation.

Type Parameters:
M - type of first element of the key
N - type of second element of the key
W - type of cached values
Parameters:
valueRetriever - value retriever for the cache
Returns:
new cache instance

get

public V get(K first,
             L second)


Copyright © 2002-2010 Atlassian. All Rights Reserved.