All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.chutneytesting.tools.FunctionCacheLoader Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package com.chutneytesting.tools;

import com.google.common.cache.CacheLoader;
import java.util.function.Function;

/**
 * Bridge between {@link Function} and {@link CacheLoader}.
* {@link CacheLoader} has the same erasure as {@link Function}, but as an abstract class it cannot be created without initialization (constructor). */ class FunctionCacheLoader extends CacheLoader { private final Function loader; FunctionCacheLoader(Function loader) { this.loader = loader; } @Override public V load(K key) throws Exception { return loader.apply(key); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy