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

wtf.metio.memoization.jool.MemoizeJool Maven / Gradle / Ivy

/*
 * SPDX-FileCopyrightText: The memoization.java Authors
 * SPDX-License-Identifier: 0BSD
 */

package wtf.metio.memoization.jool;

import edu.umd.cs.findbugs.annotations.CheckReturnValue;
import org.jooq.lambda.fi.lang.CheckedRunnable;
import org.jooq.lambda.fi.util.concurrent.CheckedCallable;
import org.jooq.lambda.fi.util.function.CheckedBiConsumer;
import org.jooq.lambda.function.*;
import wtf.metio.memoization.core.MemoizationDefaults;

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

import static java.util.Collections.emptyMap;
import static java.util.function.Function.identity;
import static wtf.metio.memoization.core.ConcurrentMaps.asConcurrentMap;
import static wtf.metio.memoization.core.MemoizationDefaults.staticKey;

/**
 * 

* Factory for lightweight wrappers that store the result of a potentially expensive function call. Each method of this * class exposes two of the following features: *

* Default cache *

* The memoizer uses the default cache of this factory. Current implementation creates a new * {@link java.util.concurrent.ConcurrentMap} per memoizer. *

* Default cache key *

* The memoizer uses the default key function or {@link Supplier} to calculate the cache key for each call. Either * uses the natural key (e.g. the input itself) or one of the methods in {@link MemoizationDefaults}. *

* Custom cache *

* The memoizer uses a user-provided {@link java.util.concurrent.ConcurrentMap} as its cache. It is possible to add * values to the cache both before and after the memoizer was created. In case a {@link Map} subtype is provided that is * not a subclass of {@link java.util.concurrent.ConcurrentMap} as well, the map entries will be copied to a new * {@link java.util.concurrent.ConcurrentHashMap}. *

* Custom cache key *

* The memoizer uses a user-defined function or {@link Supplier} to calculate the cache key for each call. * Take a look at {@link MemoizationDefaults} for a possible key functions and suppliers. *

* * @see CheckedBiConsumer * @see CheckedCallable * @see CheckedRunnable * @see Consumer0 * @see Consumer1 * @see Consumer2 * @see Consumer3 * @see Consumer4 * @see Consumer5 * @see Consumer6 * @see Consumer7 * @see Consumer8 * @see Consumer9 * @see Consumer10 * @see Consumer11 * @see Consumer12 * @see Consumer13 * @see Consumer14 * @see Consumer15 * @see Consumer16 * @see Function0 * @see Function1 * @see Function2 * @see Function3 * @see Function4 * @see Function5 * @see Function6 * @see Function7 * @see Function8 * @see Function9 * @see Function10 * @see Function11 * @see Function12 * @see Function13 * @see Function14 * @see Function15 * @see Function16 * @see Wikipedia: Memoization */ public final class MemoizeJool { private MemoizeJool() { // factory class } /** *

* Memoizes a {@link Consumer0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param consumer The {@link Consumer0} to memoize. * @return The wrapped {@link Consumer0}. */ @CheckReturnValue public static Consumer0 consumer0(final Consumer0 consumer) { return consumer0(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param consumer The {@link Consumer0} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer0}. */ @CheckReturnValue public static Consumer0 consumer0( final Consumer0 consumer, final Map cache) { return consumer0(consumer, staticKey(), cache); } /** *

* Memoizes a {@link Consumer0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param consumer The {@link Consumer0} to memoize. * @param keySupplier The {@link Supplier} to get the cache key. * @return The wrapped {@link Consumer0}. */ @CheckReturnValue public static Consumer0 consumer0( final Consumer0 consumer, final Supplier keySupplier) { return consumer0(consumer, keySupplier, emptyMap()); } /** *

* Memoizes a {@link Consumer0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param consumer The {@link Consumer0} to memoize. * @param keySupplier The {@link Supplier} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer0}. */ @CheckReturnValue public static Consumer0 consumer0( final Consumer0 consumer, final Supplier keySupplier, final Map cache) { return new Consumer0Memoizer<>(asConcurrentMap(cache), keySupplier, consumer); } /** *

* Memoizes a {@link Consumer1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param consumer The {@link Consumer1} to memoize. * @return The wrapped {@link Consumer1}. */ @CheckReturnValue public static Consumer1 consumer1(final Consumer1 consumer) { return consumer1(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param consumer The {@link Consumer1} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer1}. */ @CheckReturnValue public static Consumer1 consumer1( final Consumer1 consumer, final Map cache) { return consumer1(consumer, identity(), cache); } /** *

* Memoizes a {@link Consumer1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param consumer The {@link Consumer1} to memoize. * @param keyFunction The {@link Function} to compute the cache key. * @return The wrapped {@link Consumer1}. */ @CheckReturnValue public static Consumer1 consumer1( final Consumer1 consumer, final Function keyFunction) { return consumer1(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param consumer The {@link Consumer1} to memoize. * @param keyFunction The {@link Function} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer1}. */ @CheckReturnValue public static Consumer1 consumer1( final Consumer1 consumer, final Function keyFunction, final Map cache) { return new Consumer1Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param consumer The {@link Consumer2} to memoize. * @return The wrapped {@link Consumer2}. */ @CheckReturnValue public static Consumer2 consumer2(final Consumer2 consumer) { return consumer2(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param consumer The {@link Consumer2} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer2}. */ @CheckReturnValue public static Consumer2 consumer2( final Consumer2 consumer, final Map cache) { return consumer2(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param consumer The {@link Consumer2} to memoize. * @param keyFunction The {@link BiFunction} to compute the cache key. * @return The wrapped {@link Consumer2}. */ @CheckReturnValue public static Consumer2 consumer2( final Consumer2 consumer, final BiFunction keyFunction) { return consumer2(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param consumer The {@link Consumer2} to memoize. * @param keyFunction The {@link BiFunction} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer2}. */ @CheckReturnValue public static Consumer2 consumer2( final Consumer2 consumer, final BiFunction keyFunction, final Map cache) { return new Consumer2Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param consumer The {@link Consumer3} to memoize. * @return The wrapped {@link Consumer3}. */ @CheckReturnValue public static Consumer3 consumer3( final Consumer3 consumer) { return consumer3(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param consumer The {@link Consumer3} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer3}. */ @CheckReturnValue public static Consumer3 consumer3( final Consumer3 consumer, final Map cache) { return consumer3(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param consumer The {@link Consumer3} to memoize. * @param keyFunction The {@link Function3} to compute the cache key. * @return The wrapped {@link Consumer3}. */ @CheckReturnValue public static Consumer3 consumer3( final Consumer3 consumer, final Function3 keyFunction) { return consumer3(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param consumer The {@link Consumer3} to memoize. * @param keyFunction The {@link Function3} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer3}. */ @CheckReturnValue public static Consumer3 consumer3( final Consumer3 consumer, final Function3 keyFunction, final Map cache) { return new Consumer3Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param consumer The {@link Consumer4} to memoize. * @return The wrapped {@link Consumer4}. */ @CheckReturnValue public static Consumer4 consumer4( final Consumer4 consumer) { return consumer4(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param consumer The {@link Consumer4} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer4}. */ @CheckReturnValue public static Consumer4 consumer4( final Consumer4 consumer, final Map cache) { return consumer4(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param consumer The {@link Consumer4} to memoize. * @param keyFunction The {@link Function4} to compute the cache key. * @return The wrapped {@link Consumer4}. */ @CheckReturnValue public static Consumer4 consumer4( final Consumer4 consumer, final Function4 keyFunction) { return consumer4(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param consumer The {@link Consumer4} to memoize. * @param keyFunction The {@link Function4} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer4}. */ @CheckReturnValue public static Consumer4 consumer4( final Consumer4 consumer, final Function4 keyFunction, final Map cache) { return new Consumer4Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param consumer The {@link Consumer5} to memoize. * @return The wrapped {@link Consumer5}. */ @CheckReturnValue public static Consumer5 consumer5( final Consumer5 consumer) { return consumer5(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param consumer The {@link Consumer5} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer5}. */ @CheckReturnValue public static Consumer5 consumer5( final Consumer5 consumer, final Map cache) { return consumer5(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param consumer The {@link Consumer5} to memoize. * @param keyFunction The {@link Function5} to compute the cache key. * @return The wrapped {@link Consumer5}. */ @CheckReturnValue public static Consumer5 consumer5( final Consumer5 consumer, final Function5 keyFunction) { return consumer5(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param consumer The {@link Consumer5} to memoize. * @param keyFunction The {@link Function5} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer5}. */ @CheckReturnValue public static Consumer5 consumer5( final Consumer5 consumer, final Function5 keyFunction, final Map cache) { return new Consumer5Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param consumer The {@link Consumer6} to memoize. * @return The wrapped {@link Consumer6}. */ @CheckReturnValue public static Consumer6 consumer6( final Consumer6 consumer) { return consumer6(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param consumer The {@link Consumer6} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer6}. */ @CheckReturnValue public static Consumer6 consumer6( final Consumer6 consumer, final Map cache) { return consumer6(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param consumer The {@link Consumer6} to memoize. * @param keyFunction The {@link Function6} to compute the cache key. * @return The wrapped {@link Consumer6}. */ @CheckReturnValue public static Consumer6 consumer6( final Consumer6 consumer, final Function6 keyFunction) { return consumer6(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param consumer The {@link Consumer6} to memoize. * @param keyFunction The {@link Function6} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer6}. */ @CheckReturnValue public static Consumer6 consumer6( final Consumer6 consumer, final Function6 keyFunction, final Map cache) { return new Consumer6Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param consumer The {@link Consumer7} to memoize. * @return The wrapped {@link Consumer7}. */ @CheckReturnValue public static Consumer7 consumer7( final Consumer7 consumer) { return consumer7(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param consumer The {@link Consumer7} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer7}. */ @CheckReturnValue public static Consumer7 consumer7( final Consumer7 consumer, final Map cache) { return consumer7(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param consumer The {@link Consumer7} to memoize. * @param keyFunction The {@link Function7} to compute the cache key. * @return The wrapped {@link Consumer7}. */ @CheckReturnValue public static Consumer7 consumer7( final Consumer7 consumer, final Function7 keyFunction) { return consumer7(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param consumer The {@link Consumer7} to memoize. * @param keyFunction The {@link Function7} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer7}. */ @CheckReturnValue public static Consumer7 consumer7( final Consumer7 consumer, final Function7 keyFunction, final Map cache) { return new Consumer7Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param consumer The {@link Consumer8} to memoize. * @return The wrapped {@link Consumer8}. */ @CheckReturnValue public static Consumer8 consumer8( final Consumer8 consumer) { return consumer8(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param consumer The {@link Consumer8} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer8}. */ @CheckReturnValue public static Consumer8 consumer8( final Consumer8 consumer, final Map cache) { return consumer8(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param consumer The {@link Consumer8} to memoize. * @param keyFunction The {@link Function8} to compute the cache key. * @return The wrapped {@link Consumer8}. */ @CheckReturnValue public static Consumer8 consumer8( final Consumer8 consumer, final Function8 keyFunction) { return consumer8(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param consumer The {@link Consumer8} to memoize. * @param keyFunction The {@link Function8} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer8}. */ @CheckReturnValue public static Consumer8 consumer8( final Consumer8 consumer, final Function8 keyFunction, final Map cache) { return new Consumer8Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param consumer The {@link Consumer9} to memoize. * @return The wrapped {@link Consumer9}. */ @CheckReturnValue public static Consumer9 consumer9( final Consumer9 consumer) { return consumer9(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param consumer The {@link Consumer9} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer9}. */ @CheckReturnValue public static Consumer9 consumer9( final Consumer9 consumer, final Map cache) { return consumer9(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param consumer The {@link Consumer9} to memoize. * @param keyFunction The {@link Function9} to compute the cache key. * @return The wrapped {@link Consumer9}. */ @CheckReturnValue public static Consumer9 consumer9( final Consumer9 consumer, final Function9 keyFunction) { return consumer9(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param consumer The {@link Consumer9} to memoize. * @param keyFunction The {@link Function9} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer9}. */ @CheckReturnValue public static Consumer9 consumer9( final Consumer9 consumer, final Function9 keyFunction, final Map cache) { return new Consumer9Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param consumer The {@link Consumer10} to memoize. * @return The wrapped {@link Consumer10}. */ @CheckReturnValue public static Consumer10 consumer10( final Consumer10 consumer) { return consumer10(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param consumer The {@link Consumer10} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer10}. */ @CheckReturnValue public static Consumer10 consumer10( final Consumer10 consumer, final Map cache) { return consumer10(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param consumer The {@link Consumer10} to memoize. * @param keyFunction The {@link Function10} to compute the cache key. * @return The wrapped {@link Consumer10}. */ @CheckReturnValue public static Consumer10 consumer10( final Consumer10 consumer, final Function10 keyFunction) { return consumer10(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param consumer The {@link Consumer10} to memoize. * @param keyFunction The {@link Function10} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer10}. */ @CheckReturnValue public static Consumer10 consumer10( final Consumer10 consumer, final Function10 keyFunction, final Map cache) { return new Consumer10Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param consumer The {@link Consumer11} to memoize. * @return The wrapped {@link Consumer11}. */ @CheckReturnValue public static Consumer11 consumer11( final Consumer11 consumer) { return consumer11(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param consumer The {@link Consumer11} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer11}. */ @CheckReturnValue public static Consumer11 consumer11( final Consumer11 consumer, final Map cache) { return consumer11(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param consumer The {@link Consumer11} to memoize. * @param keyFunction The {@link Function11} to compute the cache key. * @return The wrapped {@link Consumer11}. */ @CheckReturnValue public static Consumer11 consumer11( final Consumer11 consumer, final Function11 keyFunction) { return consumer11(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param consumer The {@link Consumer11} to memoize. * @param keyFunction The {@link Function11} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer11}. */ @CheckReturnValue public static Consumer11 consumer11( final Consumer11 consumer, final Function11 keyFunction, final Map cache) { return new Consumer11Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param consumer The {@link Consumer12} to memoize. * @return The wrapped {@link Consumer12}. */ @CheckReturnValue public static Consumer12 consumer12( final Consumer12 consumer) { return consumer12(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param consumer The {@link Consumer12} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer12}. */ @CheckReturnValue public static Consumer12 consumer12( final Consumer12 consumer, final Map cache) { return consumer12(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param consumer The {@link Consumer12} to memoize. * @param keyFunction The {@link Function12} to compute the cache key. * @return The wrapped {@link Consumer12}. */ @CheckReturnValue public static Consumer12 consumer12( final Consumer12 consumer, final Function12 keyFunction) { return consumer12(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param consumer The {@link Consumer12} to memoize. * @param keyFunction The {@link Function12} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer12}. */ @CheckReturnValue public static Consumer12 consumer12( final Consumer12 consumer, final Function12 keyFunction, final Map cache) { return new Consumer12Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param consumer The {@link Consumer13} to memoize. * @return The wrapped {@link Consumer13}. */ @CheckReturnValue public static Consumer13 consumer13( final Consumer13 consumer) { return consumer13(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param consumer The {@link Consumer13} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer13}. */ @CheckReturnValue public static Consumer13 consumer13( final Consumer13 consumer, final Map cache) { return consumer13(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param consumer The {@link Consumer13} to memoize. * @param keyFunction The {@link Function13} to compute the cache key. * @return The wrapped {@link Consumer13}. */ @CheckReturnValue public static Consumer13 consumer13( final Consumer13 consumer, final Function13 keyFunction) { return consumer13(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param consumer The {@link Consumer13} to memoize. * @param keyFunction The {@link Function13} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer13}. */ @CheckReturnValue public static Consumer13 consumer13( final Consumer13 consumer, final Function13 keyFunction, final Map cache) { return new Consumer13Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param consumer The {@link Consumer14} to memoize. * @return The wrapped {@link Consumer14}. */ @CheckReturnValue public static Consumer14 consumer14( final Consumer14 consumer) { return consumer14(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param consumer The {@link Consumer14} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer14}. */ @CheckReturnValue public static Consumer14 consumer14( final Consumer14 consumer, final Map cache) { return consumer14(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param consumer The {@link Consumer14} to memoize. * @param keyFunction The {@link Function14} to compute the cache key. * @return The wrapped {@link Consumer14}. */ @CheckReturnValue public static Consumer14 consumer14( final Consumer14 consumer, final Function14 keyFunction) { return consumer14(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param consumer The {@link Consumer14} to memoize. * @param keyFunction The {@link Function14} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer14}. */ @CheckReturnValue public static Consumer14 consumer14( final Consumer14 consumer, final Function14 keyFunction, final Map cache) { return new Consumer14Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param consumer The {@link Consumer15} to memoize. * @return The wrapped {@link Consumer15}. */ @CheckReturnValue public static Consumer15 consumer15( final Consumer15 consumer) { return consumer15(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param consumer The {@link Consumer15} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer15}. */ @CheckReturnValue public static Consumer15 consumer15( final Consumer15 consumer, final Map cache) { return consumer15(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param consumer The {@link Consumer15} to memoize. * @param keyFunction The {@link Function15} to compute the cache key. * @return The wrapped {@link Consumer15}. */ @CheckReturnValue public static Consumer15 consumer15( final Consumer15 consumer, final Function15 keyFunction) { return consumer15(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param consumer The {@link Consumer15} to memoize. * @param keyFunction The {@link Function15} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer15}. */ @CheckReturnValue public static Consumer15 consumer15( final Consumer15 consumer, final Function15 keyFunction, final Map cache) { return new Consumer15Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Consumer16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param consumer The {@link Consumer16} to memoize. * @return The wrapped {@link Consumer16}. */ @CheckReturnValue public static Consumer16 consumer16( final Consumer16 consumer) { return consumer16(consumer, emptyMap()); } /** *

* Memoizes a {@link Consumer16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param consumer The {@link Consumer16} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer16}. */ @CheckReturnValue public static Consumer16 consumer16( final Consumer16 consumer, final Map cache) { return consumer16(consumer, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Consumer16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param consumer The {@link Consumer16} to memoize. * @param keyFunction The {@link Function16} to compute the cache key. * @return The wrapped {@link Consumer16}. */ @CheckReturnValue public static Consumer16 consumer16( final Consumer16 consumer, final Function16 keyFunction) { return consumer16(consumer, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Consumer16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the fourth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param consumer The {@link Consumer16} to memoize. * @param keyFunction The {@link Function16} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Consumer16}. */ @CheckReturnValue public static Consumer16 consumer16( final Consumer16 consumer, final Function16 keyFunction, final Map cache) { return new Consumer16Memoizer<>(asConcurrentMap(cache), keyFunction, consumer); } /** *

* Memoizes a {@link Function0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the output/cache value. * @param function The {@link Function0} to memoize. * @return The wrapped {@link Function0}. */ @CheckReturnValue public static Function0 function0(final Function0 function) { return function0(function, emptyMap()); } /** *

* Memoizes a {@link Function0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the output/cache value. * @param function The {@link Function0} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function0}. */ @CheckReturnValue public static Function0 function0( final Function0 function, final Map cache) { return function0(function, staticKey(), cache); } /** *

* Memoizes a {@link Function0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the output/cache value. * @param function The {@link Function0} to memoize. * @param keySupplier The {@link Supplier} to get the cache key. * @return The wrapped {@link Function0}. */ @CheckReturnValue public static Function0 function0( final Function0 function, final Supplier keySupplier) { return function0(function, keySupplier, emptyMap()); } /** *

* Memoizes a {@link Function0} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the output/cache value. * @param function The {@link Function0} to memoize. * @param keySupplier The {@link Supplier} to get the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function0}. */ @CheckReturnValue public static Function0 function0( final Function0 function, final Supplier keySupplier, final Map cache) { return new Function0Memoizer<>(asConcurrentMap(cache), keySupplier, function); } /** *

* Memoizes a {@link Function1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the output/cache value. * @param function The {@link Function1} to memoize. * @return The wrapped {@link Function1}. */ @CheckReturnValue public static Function1 function1( final Function1 function) { return function1(function, emptyMap()); } /** *

* Memoizes a {@link Function1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the output/cache value. * @param function The {@link Function1} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function1}. */ @CheckReturnValue public static Function1 function1( final Function1 function, final Map cache) { return function1(function, identity(), cache); } /** *

* Memoizes a {@link Function1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the output/cache value. * @param function The {@link Function1} to memoize. * @param keyFunction The {@link Function} to compute the cache key. * @return The wrapped {@link Function1}. */ @CheckReturnValue public static Function1 function1( final Function1 function, final Function keyFunction) { return function1(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function1} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the output/cache value. * @param function The {@link Function1} to memoize. * @param keyFunction The {@link Function} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function1}. */ @CheckReturnValue public static Function1 function1( final Function1 function, final Function keyFunction, final Map cache) { return new Function1Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the output/cache value. * @param function The {@link Function2} to memoize. * @return The wrapped {@link Function2}. */ @CheckReturnValue public static Function2 function2( final Function2 function) { return function2(function, emptyMap()); } /** *

* Memoizes a {@link Function2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the output/cache value. * @param function The {@link Function2} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function2}. */ @CheckReturnValue public static Function2 function2( final Function2 function, final Map cache) { return function2(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the output/cache value. * @param function The {@link Function2} to memoize. * @param keyFunction The {@link BiFunction} to compute the cache key. * @return The wrapped {@link Function2}. */ @CheckReturnValue public static Function2 function2( final Function2 function, final BiFunction keyFunction) { return function2(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function2} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the output/cache value. * @param function The {@link Function2} to memoize. * @param keyFunction The {@link BiFunction} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function2}. */ @CheckReturnValue public static Function2 function2( final Function2 function, final BiFunction keyFunction, final Map cache) { return new Function2Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the output/cache value. * @param function The {@link Function3} to memoize. * @return The wrapped {@link Function3}. */ @CheckReturnValue public static Function3 function3( final Function3 function) { return function3(function, emptyMap()); } /** *

* Memoizes a {@link Function3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the output/cache value. * @param function The {@link Function3} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function3}. */ @CheckReturnValue public static Function3 function3( final Function3 function, final Map cache) { return function3(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the output/cache value. * @param function The {@link Function3} to memoize. * @param keyFunction The {@link Function3} to compute the cache key. * @return The wrapped {@link Function3}. */ @CheckReturnValue public static Function3 function3( final Function3 function, final Function3 keyFunction) { return function3(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function3} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the output/cache value. * @param function The {@link Function3} to memoize. * @param keyFunction The {@link Function3} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function3}. */ @CheckReturnValue public static Function3 function3( final Function3 function, final Function3 keyFunction, final Map cache) { return new Function3Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the output/cache value. * @param function The {@link Function4} to memoize. * @return The wrapped {@link Function4}. */ @CheckReturnValue public static Function4 function4( final Function4 function) { return function4(function, emptyMap()); } /** *

* Memoizes a {@link Function4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the output/cache value. * @param function The {@link Function4} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function4}. */ @CheckReturnValue public static Function4 function4( final Function4 function, final Map cache) { return function4(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the output/cache value. * @param function The {@link Function4} to memoize. * @param keyFunction The {@link Function4} to compute the cache key. * @return The wrapped {@link Function4}. */ @CheckReturnValue public static Function4 function4( final Function4 function, final Function4 keyFunction) { return function4(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function4} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the output/cache value. * @param function The {@link Function4} to memoize. * @param keyFunction The {@link Function4} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function4}. */ @CheckReturnValue public static Function4 function4( final Function4 function, final Function4 keyFunction, final Map cache) { return new Function4Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the output/cache value. * @param function The {@link Function5} to memoize. * @return The wrapped {@link Function5}. */ @CheckReturnValue public static Function5 function5( final Function5 function) { return function5(function, emptyMap()); } /** *

* Memoizes a {@link Function5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the output/cache value. * @param function The {@link Function5} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function5}. */ @CheckReturnValue public static Function5 function5( final Function5 function, final Map cache) { return function5(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the output/cache value. * @param function The {@link Function5} to memoize. * @param keyFunction The {@link Function5} to compute the cache key. * @return The wrapped {@link Function5}. */ @CheckReturnValue public static Function5 function5( final Function5 function, final Function5 keyFunction) { return function5(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function5} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the output/cache value. * @param function The {@link Function5} to memoize. * @param keyFunction The {@link Function5} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function5}. */ @CheckReturnValue public static Function5 function5( final Function5 function, final Function5 keyFunction, final Map cache) { return new Function5Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the output/cache value. * @param function The {@link Function6} to memoize. * @return The wrapped {@link Function6}. */ @CheckReturnValue public static Function6 function6( final Function6 function) { return function6(function, emptyMap()); } /** *

* Memoizes a {@link Function6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the output/cache value. * @param function The {@link Function6} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function6}. */ @CheckReturnValue public static Function6 function6( final Function6 function, final Map cache) { return function6(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the output/cache value. * @param function The {@link Function6} to memoize. * @param keyFunction The {@link Function6} to compute the cache key. * @return The wrapped {@link Function6}. */ @CheckReturnValue public static Function6 function6( final Function6 function, final Function6 keyFunction) { return function6(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function6} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the output/cache value. * @param function The {@link Function6} to memoize. * @param keyFunction The {@link Function6} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function6}. */ @CheckReturnValue public static Function6 function6( final Function6 function, final Function6 keyFunction, final Map cache) { return new Function6Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the output/cache value. * @param function The {@link Function7} to memoize. * @return The wrapped {@link Function7}. */ @CheckReturnValue public static Function7 function7( final Function7 function) { return function7(function, emptyMap()); } /** *

* Memoizes a {@link Function7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the output/cache value. * @param function The {@link Function7} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function7}. */ @CheckReturnValue public static Function7 function7( final Function7 function, final Map cache) { return function7(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the output/cache value. * @param function The {@link Function7} to memoize. * @param keyFunction The {@link Function7} to compute the cache key. * @return The wrapped {@link Function7}. */ @CheckReturnValue public static Function7 function7( final Function7 function, final Function7 keyFunction) { return function7(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function7} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the output/cache value. * @param function The {@link Function7} to memoize. * @param keyFunction The {@link Function7} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function7}. */ @CheckReturnValue public static Function7 function7( final Function7 function, final Function7 keyFunction, final Map cache) { return new Function7Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the output/cache value. * @param function The {@link Function8} to memoize. * @return The wrapped {@link Function8}. */ @CheckReturnValue public static Function8 function8( final Function8 function) { return function8(function, emptyMap()); } /** *

* Memoizes a {@link Function8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the output/cache value. * @param function The {@link Function8} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function8}. */ @CheckReturnValue public static Function8 function8( final Function8 function, final Map cache) { return function8(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the output/cache value. * @param function The {@link Function8} to memoize. * @param keyFunction The {@link Function8} to compute the cache key. * @return The wrapped {@link Function8}. */ @CheckReturnValue public static Function8 function8( final Function8 function, final Function8 keyFunction) { return function8(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function8} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the output/cache value. * @param function The {@link Function8} to memoize. * @param keyFunction The {@link Function8} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function8}. */ @CheckReturnValue public static Function8 function8( final Function8 function, final Function8 keyFunction, final Map cache) { return new Function8Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the output/cache value. * @param function The {@link Function9} to memoize. * @return The wrapped {@link Function9}. */ @CheckReturnValue public static Function9 function9( final Function9 function) { return function9(function, emptyMap()); } /** *

* Memoizes a {@link Function9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the output/cache value. * @param function The {@link Function9} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function9}. */ @CheckReturnValue public static Function9 function9( final Function9 function, final Map cache) { return function9(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the output/cache value. * @param function The {@link Function9} to memoize. * @param keyFunction The {@link Function9} to compute the cache key. * @return The wrapped {@link Function9}. */ @CheckReturnValue public static Function9 function9( final Function9 function, final Function9 keyFunction) { return function9(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function9} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the output/cache value. * @param function The {@link Function9} to memoize. * @param keyFunction The {@link Function9} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function9}. */ @CheckReturnValue public static Function9 function9( final Function9 function, final Function9 keyFunction, final Map cache) { return new Function9Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the output/cache value. * @param function The {@link Function10} to memoize. * @return The wrapped {@link Function10}. */ @CheckReturnValue public static Function10 function10( final Function10 function) { return function10(function, emptyMap()); } /** *

* Memoizes a {@link Function10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the output/cache value. * @param function The {@link Function10} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function10}. */ @CheckReturnValue public static Function10 function10( final Function10 function, final Map cache) { return function10(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the output/cache value. * @param function The {@link Function10} to memoize. * @param keyFunction The {@link Function10} to compute the cache key. * @return The wrapped {@link Function10}. */ @CheckReturnValue public static Function10 function10( final Function10 function, final Function10 keyFunction) { return function10(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function10} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the output/cache value. * @param function The {@link Function10} to memoize. * @param keyFunction The {@link Function10} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function10}. */ @CheckReturnValue public static Function10 function10( final Function10 function, final Function10 keyFunction, final Map cache) { return new Function10Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the output/cache value. * @param function The {@link Function11} to memoize. * @return The wrapped {@link Function11}. */ @CheckReturnValue public static Function11 function11( final Function11 function) { return function11(function, emptyMap()); } /** *

* Memoizes a {@link Function11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the output/cache value. * @param function The {@link Function11} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function11}. */ @CheckReturnValue public static Function11 function11( final Function11 function, final Map cache) { return function11(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the output/cache value. * @param function The {@link Function11} to memoize. * @param keyFunction The {@link Function11} to compute the cache key. * @return The wrapped {@link Function11}. */ @CheckReturnValue public static Function11 function11( final Function11 function, final Function11 keyFunction) { return function11(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function11} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the output/cache value. * @param function The {@link Function11} to memoize. * @param keyFunction The {@link Function11} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function11}. */ @CheckReturnValue public static Function11 function11( final Function11 function, final Function11 keyFunction, final Map cache) { return new Function11Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the output/cache value. * @param function The {@link Function12} to memoize. * @return The wrapped {@link Function12}. */ @CheckReturnValue public static Function12 function12( final Function12 function) { return function12(function, emptyMap()); } /** *

* Memoizes a {@link Function12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the output/cache value. * @param function The {@link Function12} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function12}. */ @CheckReturnValue public static Function12 function12( final Function12 function, final Map cache) { return function12(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the output/cache value. * @param function The {@link Function12} to memoize. * @param keyFunction The {@link Function12} to compute the cache key. * @return The wrapped {@link Function12}. */ @CheckReturnValue public static Function12 function12( final Function12 function, final Function12 keyFunction) { return function12(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function12} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the output/cache value. * @param function The {@link Function12} to memoize. * @param keyFunction The {@link Function12} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function12}. */ @CheckReturnValue public static Function12 function12( final Function12 function, final Function12 keyFunction, final Map cache) { return new Function12Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function13} to memoize. * @return The wrapped {@link Function13}. */ @CheckReturnValue public static Function13 function13( final Function13 function) { return function13(function, emptyMap()); } /** *

* Memoizes a {@link Function13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function13} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function13}. */ @CheckReturnValue public static Function13 function13( final Function13 function, final Map cache) { return function13(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function13} to memoize. * @param keyFunction The {@link Function13} to compute the cache key. * @return The wrapped {@link Function13}. */ @CheckReturnValue public static Function13 function13( final Function13 function, final Function13 keyFunction) { return function13(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function13} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function13} to memoize. * @param keyFunction The {@link Function13} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function13}. */ @CheckReturnValue public static Function13 function13( final Function13 function, final Function13 keyFunction, final Map cache) { return new Function13Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function14} to memoize. * @return The wrapped {@link Function14}. */ @CheckReturnValue public static Function14 function14( final Function14 function) { return function14(function, emptyMap()); } /** *

* Memoizes a {@link Function14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function14} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function14}. */ @CheckReturnValue public static Function14 function14( final Function14 function, final Map cache) { return function14(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function14} to memoize. * @param keyFunction The {@link Function14} to compute the cache key. * @return The wrapped {@link Function14}. */ @CheckReturnValue public static Function14 function14( final Function14 function, final Function14 keyFunction) { return function14(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function14} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function14} to memoize. * @param keyFunction The {@link Function14} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function14}. */ @CheckReturnValue public static Function14 function14( final Function14 function, final Function14 keyFunction, final Map cache) { return new Function14Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function15} to memoize. * @return The wrapped {@link Function15}. */ @CheckReturnValue public static Function15 function15( final Function15 function) { return function15(function, emptyMap()); } /** *

* Memoizes a {@link Function15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function15} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function15}. */ @CheckReturnValue public static Function15 function15( final Function15 function, final Map cache) { return function15(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function15} to memoize. * @param keyFunction The {@link Function15} to compute the cache key. * @return The wrapped {@link Function15}. */ @CheckReturnValue public static Function15 function15( final Function15 function, final Function15 keyFunction) { return function15(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function15} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function15} to memoize. * @param keyFunction The {@link Function15} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function15}. */ @CheckReturnValue public static Function15 function15( final Function15 function, final Function15 keyFunction, final Map cache) { return new Function15Memoizer<>(asConcurrentMap(cache), keyFunction, function); } /** *

* Memoizes a {@link Function16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function16} to memoize. * @return The wrapped {@link Function16}. */ @CheckReturnValue public static Function16 function16( final Function16 function) { return function16(function, emptyMap()); } /** *

* Memoizes a {@link Function16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Default cache key
  • *
* * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function16} to memoize. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function16}. */ @CheckReturnValue public static Function16 function16( final Function16 function, final Map cache) { return function16(function, MemoizationDefaults::hashCodes, cache); } /** *

* Memoizes a {@link Function16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Default cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function16} to memoize. * @param keyFunction The {@link Function16} to compute the cache key. * @return The wrapped {@link Function16}. */ @CheckReturnValue public static Function16 function16( final Function16 function, final Function16 keyFunction) { return function16(function, keyFunction, emptyMap()); } /** *

* Memoizes a {@link Function16} in a {@link java.util.concurrent.ConcurrentMap}. *

* *
    *
  • Custom cache
  • *
  • Custom cache key
  • *
* * @param The type of the cache key. * @param The type of the first parameter. * @param The type of the second parameter. * @param The type of the third parameter. * @param The type of the forth parameter. * @param The type of the fifth parameter. * @param The type of the sixth parameter. * @param The type of the seventh parameter. * @param The type of the eight parameter. * @param The type of the ninth parameter. * @param The type of the tenth parameter. * @param The type of the eleventh parameter. * @param The type of the twelfth parameter. * @param The type of the thirteenth parameter. * @param The type of the fourteenth parameter. * @param The type of the fifteenth parameter. * @param The type of the sixteenth parameter. * @param The type of the output/cache value. * @param function The {@link Function16} to memoize. * @param keyFunction The {@link Function16} to compute the cache key. * @param cache The {@link Map} based cache to use. * @return The wrapped {@link Function16}. */ @CheckReturnValue public static Function16 function16( final Function16 function, final Function16 keyFunction, final Map cache) { return new Function16Memoizer<>(asConcurrentMap(cache), keyFunction, function); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy