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

com.github.chaosfirebolt.converter.api.cache.Extraction Maven / Gradle / Ivy

package com.github.chaosfirebolt.converter.api.cache;

import com.github.chaosfirebolt.converter.api.cache.storage.Computation;
import com.github.chaosfirebolt.converter.api.cache.storage.Storage;

/**
 * Represents the process of extracting a value associated with a key from a storage.
 *
 * @param  key type
 * @param  value type
 */
@FunctionalInterface
public interface Extraction {

  /**
   * Extracts a value.
   *
   * @param storage     storage to extract value from
   * @param key         key the value should be associated with
   * @param computation computation to calculate the value if one is missing
   * @return the value
   */
  V extract(Storage storage, K key, Computation computation);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy