/** * <p> * Returns cached value for a key. If it does not exist, it is loaded using a {@link Retriever}. * </p> * * @param key * cache key * @return value for that key * @throws TasteException * if an exception occurs while retrieving a new cached value */ @Override public V get(K key) throws TasteException { V value; synchronized (cache) { value = cache.get(key); } if (value == null) { return getAndCacheValue(key); } return value == NULL ? null : value; }
/** * <p> * Returns cached value for a key. If it does not exist, it is loaded using a {@link Retriever}. * </p> * * @param key * cache key * @return value for that key * @throws TasteException * if an exception occurs while retrieving a new cached value */ @Override public V get(K key) throws TasteException { V value; synchronized (cache) { value = cache.get(key); } if (value == null) { return getAndCacheValue(key); } return value == NULL ? null : value; }
/** * <p> * Returns cached value for a key. If it does not exist, it is loaded using a {@link Retriever}. * </p> * * @param key * cache key * @return value for that key * @throws TasteException * if an exception occurs while retrieving a new cached value */ @Override public V get(K key) throws TasteException { V value; synchronized (cache) { value = cache.get(key); } if (value == null) { return getAndCacheValue(key); } return value == NULL ? null : value; }