Build the cache used to store resolved messages.
@return The cache.
183384
@Nonnull
    protected Map<MessageKey, Optional<String>> buildMessageCache() {
        return new ConcurrentLinkedHashMap.Builder<MessageKey, Optional<String>>()
                .maximumWeightedCapacity(100)
                .build();
    }
92688
protected com.github.benmanes.caffeine.cache.Cache buildCache(CacheConfiguration cacheConfiguration) {
        Caffeine<Object, Object> builder = Caffeine.newBuilder();
        cacheConfiguration.getExpireAfterAccess().ifPresent(duration -> builder.expireAfterAccess(duration.toMillis(), TimeUnit.MILLISECONDS));
        cacheConfiguration.getExpireAfterWrite().ifPresent(duration -> builder.expireAfterWrite(duration.toMillis(), TimeUnit.MILLISECONDS));
        cacheConfiguration.getInitialCapacity().ifPresent(builder::initialCapacity);
        cacheConfiguration.getMaximumSize().ifPresent(builder::maximumSize);
        cacheConfiguration.getMaximumWeight().ifPresent((long weight) -> {
            builder.maximumWeight(weight);
            builder.weigher(findWeigher());
        });
        if (cacheConfiguration.isRecordStats()) {
            builder.recordStats();
        }
        if (cacheConfiguration.isTestMode()) {
            // run commands on same thread
            builder.executor(Runnable::run);
        }
        return builder.build();
    }
1151013
protected static ArrayCache getArrayCache() {
        ArrayCache cache = (ArrayCache) AppContext.getAppContext().get(ArrayCache.class);

        if (cache == null) {
            cache = new ArrayCache();
            AppContext.getAppContext().put(ArrayCache.class, cache);
        }

        return cache;
    }
545416
private <T> T getCached(String prefix, String postfix, Class<T> cls) {
    return cls.cast(cache.get(prefix + '.' + postfix));
  }
1080158
public File[] build() {
        MavenStrategyStage maven = Maven.configureResolver()
                .workOffline(offline)
                .resolve(artifactCoordinates);

        return applyTransitivity(maven).asFile();
    }
1245219
public static <K, V> Cache<K, V> createCache(int maximumSize, long expiryDurationSeconds) {
        Cache<K, V> cache = CacheBuilder.newBuilder().maximumSize(maximumSize)
                .expireAfterAccess(expiryDurationSeconds, TimeUnit.SECONDS).build();
        return cache;
    }
604947
public final DataHash getHash() {
        if (outputHash == null) {
            byte[] hash = messageDigest.digest();
            outputHash = new DataHash(algorithm, hash);
        }
        return outputHash;
    }
124480
public ServiceCachingPolicy build() {
        checkState(_maxNumServiceInstances == -1 || _maxNumServiceInstancesPerEndPoint <= _maxNumServiceInstances);

        final int maxNumServiceInstances = _maxNumServiceInstances;
        final int maxNumServiceInstancesPerEndPoint = _maxNumServiceInstancesPerEndPoint;
        final long maxServiceInstanceIdleTimeNanos = _maxServiceInstanceIdleTimeNanos;
        final ExhaustionAction cacheExhaustionAction = _cacheExhaustionAction;

        return new ServiceCachingPolicy() {
            @Override
            public int getMaxNumServiceInstances() {
                return maxNumServiceInstances;
            }

            @Override
            public int getMaxNumServiceInstancesPerEndPoint() {
                return maxNumServiceInstancesPerEndPoint;
            }

            @Override
            public long getMaxServiceInstanceIdleTime(TimeUnit unit) {
                return unit.convert(maxServiceInstanceIdleTimeNanos, TimeUnit.NANOSECONDS);
            }

            @Override
            public ExhaustionAction getCacheExhaustionAction() {
                return cacheExhaustionAction;
            }

            @Override
            public boolean useMultiThreadedClientPolicy() {
                return false;
            }
        };
    }
1072087
@Override
    public <K, V> Cache<K, V> getCache(String cacheName) {
        return this.getCache(cacheName, true);
    }
526448
public Map<Integer, List<HeronTuples.HeronTupleSet>> getCache() {
    Map<Integer, List<HeronTuples.HeronTupleSet>> res =
        new HashMap<>();
    for (Map.Entry<Integer, TupleList> entry : cache.entrySet()) {
      res.put(entry.getKey(), entry.getValue().getTuplesList());
    }

    return res;
  }
266226
protected function _buildCache()
    {
        $cacheTpl = "<?php\n\$source_version=%s;\n\$cache_version=%s;\n\$properties=%s;\n\$browsers=%s;\n\$userAgents=%s;\n\$patterns=%s;\n";

        $propertiesArray = $this->_array2string($this->_properties);
        $patternsArray = $this->_array2string($this->_patterns);
        $userAgentsArray = $this->_array2string($this->_userAgents);
        $browsersArray = $this->_array2string($this->_browsers);

        return sprintf(
            $cacheTpl,
            "'" . $this->_source_version . "'",
            "'" . self::CACHE_FILE_VERSION . "'",
            $propertiesArray,
            $browsersArray,
            $userAgentsArray,
            $patternsArray
        );
    }
1253908
public static CacheConfiguration build() throws IOException {
		File file = new File(ClassLoaderUtils.getResourcePath("") + "cache.properties");
		return build(file);
	}
1012514
private boolean cacheComplete() {
      final boolean complete;
      if (m_cache != null) {
          complete = m_cache.isComplete();
      } else {
          complete = false;
      }
      return complete;
  }
41793
function getCache() {
      return new Promise(function(resolve, reject) {
        // create and fetch the cache key
        get(getKey(), function(err, data) {
          if (err) {
            return reject(err);
          }
          resolve(data);
        });
      });
    }
804014
private org.ehcache.CacheManager getEhcacheManager() {
        try {
            final Field f = eh107CacheManager.getClass().getDeclaredField("ehCacheManager");
            f.setAccessible(true);

            return (org.ehcache.CacheManager) f.get(eh107CacheManager);
        } catch (final IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (final NoSuchFieldException e) {
            throw new RuntimeException(e);
        }
    }
728593
public Query<T> build() {
    QueryBean<T> queryBean = new QueryBean<T>();
    queryBean.setStatement(genStatement());
    queryBean.setParams(getParams());
    if (null != limit) {
      queryBean.setLimit(new PageLimit(limit.getPageIndex(), limit.getPageSize()));
    }
    queryBean.setCountStatement(genCountStatement());
    queryBean.setCacheable(cacheable);
    queryBean.setLang(getLang());
    return queryBean;
  }
1228115
public FactoryCache getFactoryCache() {
        FactoryCache cache = new FactoryCache();

        cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableList", fxCollection(List.class, "observableList"));
        cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableMap", fxCollection(Map.class, "observableMap"));
        cache.put(JAVAFX_COLLECTIONS_PACKAGE + "ObservableSet", fxCollection(Set.class, "observableSet"));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "BooleanProperty", fxProperty("SimpleBooleanProperty", boolean.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "DoubleProperty", fxProperty("SimpleDoubleProperty", double.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "FloatProperty", fxProperty("SimpleFloatProperty", float.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "IntegerProperty", fxProperty("SimpleIntegerProperty", int.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "ListProperty",
            fxProperty("SimpleListProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableList")));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "LongProperty", fxProperty("SimpleLongProperty", long.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "MapProperty",
            fxProperty("SimpleMapProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableMap")));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "ObjectProperty", fxProperty("SimpleObjectProperty", Object.class));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "SetProperty",
            fxProperty("SimpleSetProperty", classForName(JAVAFX_COLLECTIONS_PACKAGE + "ObservableSet")));
        cache.put(JAVAFX_PROPERTY_PACKAGE + "StringProperty", fxProperty("SimpleStringProperty", String.class));

        return cache;
    }