List of usage examples for org.apache.commons.collections4 MapUtils getObject
public static <K, V> V getObject(final Map<? super K, V> map, final K key)
From source file:org.broadleafcommerce.core.search.service.solr.index.SolrIndexCachedOperation.java
/** * Retrieve the cache bound to the current thread. * * @return The cache for the current thread, or null if not set *///from w w w.ja v a 2s . c o m public static CatalogStructure getCache() { BroadleafRequestContext ctx = BroadleafRequestContext.getBroadleafRequestContext(); Catalog currentCatalog = ctx == null ? null : ctx.getCurrentCatalog(); if (currentCatalog != null) { return MapUtils.getObject(CACHE.get(), currentCatalog.getId()); } else { return MapUtils.getObject(CACHE.get(), DEFAULT_CATALOG_CACHE_KEY); } }