1 package com.atlassian.cache.ehcache.wrapper;
2
3 import javax.annotation.Nullable;
4
5 /**
6 * This processor will be used for wrapping/unwrapping both values and keys within a cache.
7 * It is very important to make sure the implementation is thread-safe and non-blocking. Lock usage may cause
8 * severe performance hit.
9 *
10 * {@link #wrap(Object)} will be called with keys and values passed as parameters to the cache,
11 * {@link #unwrap(Object)} will be called with the return value of the same operation.
12 *
13 * For example using {@link com.atlassian.cache.Cache#get(Object)} method will cause
14 * the execution of {@link #wrap(Object)} with the key as parameter and {@link #unwrap(Object)} with the found value as parameter.
15 *
16 * @see ValueProcessorAtlassianCacheLoaderDecorator
17 * @see ValueProcessorEhcacheLoaderDecorator
18 */
19 public interface ValueProcessor {
20 Object wrap(@Nullable Object o);
21
22 Object unwrap(@Nullable Object o);
23 }