*/
@Override
public <K, V> SearchableCache<K, V> build() {
SearchableCache<K, V> cache = null;
if (type == null || type.equals("concurrentheap")) {
ConcurrentHeapCacheBuilder builder = CacheBuilder.concurrentHeapCache();
builder.cacheLoader(cacheLoader).evictionListener(evictionListener).indexHandler(indexHandler);
cache = builder.build();
} else if (type.equals("heap")) {
HeapCacheBuilder builder = CacheBuilder.heapCache();
builder.cacheLoader(cacheLoader).evictionListener(evictionListener).indexHandler(indexHandler);
cache = builder.build();
} else if (type.equals("transactionalheap")) {
TransactionalHeapCacheBuilder builder = CacheBuilder.transactionalHeapCache();
builder.cacheLoader(cacheLoader).evictionListener(evictionListener).indexHandler(indexHandler);
cache = builder.build();
} else if (type.equals("offheap")) {
OffHeapCacheBuilder builder = CacheBuilder.offHeapCache();
builder.cacheLoader(cacheLoader).evictionListener(evictionListener).indexHandler(indexHandler)
.concurrencyLevel(concurrencyLevel).bufferCleanerPeriod(bufferCleanerPeriod)
.bufferCleanerThreshold(bufferCleanerThreshold).evictionPeriod(evictionPeriod)
.serializer(serializer).storage(bufferStore);
cache = builder.build();
} else if (type.equals("versionedoffheap")) {
VersionedOffHeapCacheBuilder builder = CacheBuilder.versionedOffHeapCache();
builder.cacheLoader(cacheLoader).evictionListener(evictionListener).indexHandler(indexHandler)
.concurrencyLevel(concurrencyLevel).bufferCleanerPeriod(bufferCleanerPeriod)
.bufferCleanerThreshold(bufferCleanerThreshold).evictionPeriod(evictionPeriod)
.serializer(serializer).storage(bufferStore);
cache = builder.build();
}
return cache;
}