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

org.jsoftware.utils.cache.Cache Maven / Gradle / Ivy

The newest version!
package org.jsoftware.utils.cache;

import java.util.Map;
import java.util.function.Supplier;

/**
 * Simple cache interface
 * @author m-szalik
 */
public interface Cache extends Map {

    /**
     * Thread-safe method fetching cache object
     * @param key cache key
     * @param supplier object supplier
     * @return object form cache or produced by supplier
     */
    V fetch(K key, Supplier supplier);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy