From e6c8605573b2bb0121164dc1c718d0218804665a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Ho=C3=9F?= Date: Tue, 29 Nov 2022 07:25:19 +0100 Subject: [PATCH] use ints as cache keys --- README.md | 6 +- .../memoization/core/MemoizationDefaults.java | 15 ++--- .../memoization/core/MemoizationDefaultsTest.java | 18 ++---- .../java/wtf/metio/memoization/jdk/Memoize.java | 38 ++++++------- .../metio/memoization/jool/Consumer0Memoizer.java | 2 +- .../metio/memoization/jool/Consumer1Memoizer.java | 2 +- .../wtf/metio/memoization/jool/MemoizeJool.java | 64 +++++++++++----------- .../metio/memoization/lambda/MemoizeLambda.java | 18 +++--- .../wtf/metio/memoization/rxjava/MemoizeRx.java | 36 ++++++------ 9 files changed, 91 insertions(+), 108 deletions(-) diff --git a/README.md b/README.md index bece58c..2bb2619 100644 --- a/README.md +++ b/README.md @@ -86,17 +86,17 @@ Function memoizedFunction = Memoize.function(function, cache.asMa // memoize in Caffeine cache Supplier supplier = ...; -Cache cache = ...; // com.github.benmanes.caffeine.cache.Cache +Cache cache = ...; // com.github.benmanes.caffeine.cache.Cache Supplier memoizedSupplier = MemoizeRx.supplier(supplier, cache.asMap()); // memoize in Guava cache Function3 function = ...; -Cache cache = ...; // com.google.common.cache.Cache +Cache cache = ...; // com.google.common.cache.Cache Function3 memoizedFunction = MemoizeJool.function3(function, cache.asMap()); // memoize in ConcurrentMap Fn4 function = ...; -Map cache = ...; +Map cache = ...; Fn4 memoizedFunction = MemoizeLambda.fn4(function, cache); ``` diff --git a/memoization-core/src/main/java/wtf/metio/memoization/core/MemoizationDefaults.java b/memoization-core/src/main/java/wtf/metio/memoization/core/MemoizationDefaults.java index 086a9b1..73575e3 100755 --- a/memoization-core/src/main/java/wtf/metio/memoization/core/MemoizationDefaults.java +++ b/memoization-core/src/main/java/wtf/metio/memoization/core/MemoizationDefaults.java @@ -5,9 +5,7 @@ package wtf.metio.memoization.core; import java.util.Arrays; -import java.util.Objects; import java.util.function.Supplier; -import java.util.stream.Collectors; /** * Defaults used throughout the library. @@ -23,8 +21,8 @@ public final class MemoizationDefaults { * * @return The default key supplier used throughout the library. */ - public static Supplier staticKey() { - return () -> "SUPPLIED"; + public static Supplier staticKey() { + return () -> 1; } /** @@ -33,13 +31,8 @@ public final class MemoizationDefaults { * @param values The values to use. * @return The constructed cache key. */ - public static String hashCodes(final Object... values) { -// return Arrays.hashCode(values); - - return Arrays.stream(values) - .map(Object::hashCode) - .map(Objects::toString) - .collect(Collectors.joining(" ")); + public static int hashCodes(final Object... values) { + return Arrays.hashCode(values); } } diff --git a/memoization-core/src/test/java/wtf/metio/memoization/core/MemoizationDefaultsTest.java b/memoization-core/src/test/java/wtf/metio/memoization/core/MemoizationDefaultsTest.java index 57c6f9a..be8107e 100755 --- a/memoization-core/src/test/java/wtf/metio/memoization/core/MemoizationDefaultsTest.java +++ b/memoization-core/src/test/java/wtf/metio/memoization/core/MemoizationDefaultsTest.java @@ -17,7 +17,7 @@ class MemoizationDefaultsTest { @Test void shouldDefineDefaultKeySupplier() { // given - Supplier keySupplier; + Supplier keySupplier; // when keySupplier = MemoizationDefaults.staticKey(); @@ -29,24 +29,14 @@ class MemoizationDefaultsTest { @Test void shouldDefineDefaultKey() { // given - final Supplier keySupplier = MemoizationDefaults.staticKey(); + final Supplier keySupplier = MemoizationDefaults.staticKey(); // when - final String defaultSuppliedKey = keySupplier.get(); + final Integer defaultSuppliedKey = keySupplier.get(); // then Assertions.assertNotNull(defaultSuppliedKey); - Assertions.assertEquals("SUPPLIED", defaultSuppliedKey); - } - - @Test - void shouldConcatHashCodesWithWhitespaceInbetween() { - // given - // when - final String calculatedKey = MemoizationDefaults.hashCodes(1, 2); - - // when - Assertions.assertEquals("1 2", calculatedKey); + Assertions.assertEquals(1, defaultSuppliedKey); } @Test diff --git a/memoization-jdk/src/main/java/wtf/metio/memoization/jdk/Memoize.java b/memoization-jdk/src/main/java/wtf/metio/memoization/jdk/Memoize.java index 69c3221..214bae2 100755 --- a/memoization-jdk/src/main/java/wtf/metio/memoization/jdk/Memoize.java +++ b/memoization-jdk/src/main/java/wtf/metio/memoization/jdk/Memoize.java @@ -132,7 +132,7 @@ public final class Memoize { @CheckReturnValue public static Callable callable( final Callable callable, - final Map cache) { + final Map cache) { return callable(callable, staticKey(), cache); } @@ -219,7 +219,7 @@ public final class Memoize { @CheckReturnValue public static Runnable runnable( final Runnable runnable, - final Map cache) { + final Map cache) { return runnable(runnable, staticKey(), cache); } @@ -332,7 +332,7 @@ public final class Memoize { @CheckReturnValue public static BiConsumer biConsumer( final BiConsumer biConsumer, - final Map cache) { + final Map cache) { return biConsumer(biConsumer, MemoizationDefaults::hashCodes, cache); } @@ -429,7 +429,7 @@ public final class Memoize { @CheckReturnValue public static BiFunction biFunction( final BiFunction biFunction, - final Map cache) { + final Map cache) { return biFunction(biFunction, MemoizationDefaults::hashCodes, cache); } @@ -523,7 +523,7 @@ public final class Memoize { @CheckReturnValue public static BiPredicate biPredicate( final BiPredicate predicate, - final Map cache) { + final Map cache) { return biPredicate(predicate, MemoizationDefaults::hashCodes, cache); } @@ -588,7 +588,7 @@ public final class Memoize { @CheckReturnValue public static BooleanSupplier booleanSupplier( final BooleanSupplier supplier, - final Map cache) { + final Map cache) { return booleanSupplier(supplier, staticKey(), cache); } @@ -808,7 +808,7 @@ public final class Memoize { @CheckReturnValue public static DoubleBinaryOperator doubleBinaryOperator( final DoubleBinaryOperator operator, - final Map cache) { + final Map cache) { return doubleBinaryOperator(operator, MemoizationDefaults::hashCodes, cache); } @@ -1106,7 +1106,7 @@ public final class Memoize { @CheckReturnValue public static DoubleSupplier doubleSupplier( final DoubleSupplier supplier, - final Map cache) { + final Map cache) { return doubleSupplier(supplier, staticKey(), cache); } @@ -1585,7 +1585,7 @@ public final class Memoize { @CheckReturnValue public static IntBinaryOperator intBinaryOperator( final IntBinaryOperator operator, - final Map cache) { + final Map cache) { return intBinaryOperator(operator, MemoizationDefaults::hashCodes, cache); } @@ -1883,7 +1883,7 @@ public final class Memoize { @CheckReturnValue public static IntSupplier intSupplier( final IntSupplier supplier, - final Map cache) { + final Map cache) { return intSupplier(supplier, staticKey(), cache); } @@ -2269,7 +2269,7 @@ public final class Memoize { @CheckReturnValue public static LongBinaryOperator longBinaryOperator( final LongBinaryOperator operator, - final Map cache) { + final Map cache) { return longBinaryOperator(operator, MemoizationDefaults::hashCodes, cache); } @@ -2567,7 +2567,7 @@ public final class Memoize { @CheckReturnValue public static LongSupplier longSupplier( final LongSupplier supplier, - final Map cache) { + final Map cache) { return longSupplier(supplier, staticKey(), cache); } @@ -2909,7 +2909,7 @@ public final class Memoize { @CheckReturnValue public static ObjDoubleConsumer objDoubleConsumer( final ObjDoubleConsumer consumer, - final Map cache) { + final Map cache) { return objDoubleConsumer(consumer, MemoizationDefaults::hashCodes, cache); } @@ -2998,7 +2998,7 @@ public final class Memoize { @CheckReturnValue public static ObjIntConsumer objIntConsumer( final ObjIntConsumer consumer, - final Map cache) { + final Map cache) { return objIntConsumer(consumer, MemoizationDefaults::hashCodes, cache); } @@ -3087,7 +3087,7 @@ public final class Memoize { @CheckReturnValue public static ObjLongConsumer objLongConsumer( final ObjLongConsumer consumer, - final Map cache) { + final Map cache) { return objLongConsumer(consumer, MemoizationDefaults::hashCodes, cache); } @@ -3265,7 +3265,7 @@ public final class Memoize { @CheckReturnValue public static Supplier supplier( final Supplier supplier, - final Map cache) { + final Map cache) { return supplier(supplier, staticKey(), asConcurrentMap(cache)); } @@ -3407,7 +3407,7 @@ public final class Memoize { @CheckReturnValue public static ToDoubleBiFunction toDoubleBiFunction( final ToDoubleBiFunction function, - final Map cache) { + final Map cache) { return toDoubleBiFunction(function, MemoizationDefaults::hashCodes, cache); } @@ -3590,7 +3590,7 @@ public final class Memoize { @CheckReturnValue public static ToIntBiFunction toIntBiFunction( final ToIntBiFunction function, - final Map cache) { + final Map cache) { return toIntBiFunction(function, MemoizationDefaults::hashCodes, cache); } @@ -3773,7 +3773,7 @@ public final class Memoize { @CheckReturnValue public static ToLongBiFunction toLongBiFunction( final ToLongBiFunction function, - final Map cache) { + final Map cache) { return toLongBiFunction(function, MemoizationDefaults::hashCodes, cache); } diff --git a/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer0Memoizer.java b/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer0Memoizer.java index 3ff0635..7e93f9e 100644 --- a/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer0Memoizer.java +++ b/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer0Memoizer.java @@ -26,7 +26,7 @@ final class Consumer0Memoizer final Consumer0 consumer) { super(cache); this.keySupplier = requireNonNull(keySupplier, - "Provide a key supplier, might just be 'MemoizationDefaults.defaultKeySupplier()'."); + "Provide a key supplier, might just be 'MemoizationDefaults.staticKey()'."); this.consumer = requireNonNull(consumer, "Cannot memoize a NULL Consumer0 - provide an actual Consumer0 to fix this."); } diff --git a/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer1Memoizer.java b/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer1Memoizer.java index 217e3b3..a434050 100644 --- a/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer1Memoizer.java +++ b/memoization-jool/src/main/java/wtf/metio/memoization/jool/Consumer1Memoizer.java @@ -26,7 +26,7 @@ final class Consumer1Memoizer final Consumer1 consumer) { super(cache); this.keyFunction = requireNonNull(keyFunction, - "Provide a key function, might just be 'MemoizationDefaults.defaultKeySupplier()'."); + "Provide a key function, might just be 'MemoizationDefaults.staticKey()'."); this.consumer = requireNonNull(consumer, "Cannot memoize a NULL Consumer1 - provide an actual Consumer1 to fix this."); } diff --git a/memoization-jool/src/main/java/wtf/metio/memoization/jool/MemoizeJool.java b/memoization-jool/src/main/java/wtf/metio/memoization/jool/MemoizeJool.java index fbcf52d..b611bef 100644 --- a/memoization-jool/src/main/java/wtf/metio/memoization/jool/MemoizeJool.java +++ b/memoization-jool/src/main/java/wtf/metio/memoization/jool/MemoizeJool.java @@ -130,7 +130,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer0 consumer0( final Consumer0 consumer, - final Map cache) { + final Map cache) { return consumer0(consumer, staticKey(), cache); } @@ -308,7 +308,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer2 consumer2( final Consumer2 consumer, - final Map cache) { + final Map cache) { return consumer2(consumer, MemoizationDefaults::hashCodes, cache); } @@ -404,7 +404,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer3 consumer3( final Consumer3 consumer, - final Map cache) { + final Map cache) { return consumer3(consumer, MemoizationDefaults::hashCodes, cache); } @@ -504,7 +504,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer4 consumer4( final Consumer4 consumer, - final Map cache) { + final Map cache) { return consumer4(consumer, MemoizationDefaults::hashCodes, cache); } @@ -608,7 +608,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer5 consumer5( final Consumer5 consumer, - final Map cache) { + final Map cache) { return consumer5(consumer, MemoizationDefaults::hashCodes, cache); } @@ -716,7 +716,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer6 consumer6( final Consumer6 consumer, - final Map cache) { + final Map cache) { return consumer6(consumer, MemoizationDefaults::hashCodes, cache); } @@ -828,7 +828,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer7 consumer7( final Consumer7 consumer, - final Map cache) { + final Map cache) { return consumer7(consumer, MemoizationDefaults::hashCodes, cache); } @@ -944,7 +944,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer8 consumer8( final Consumer8 consumer, - final Map cache) { + final Map cache) { return consumer8(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1064,7 +1064,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer9 consumer9( final Consumer9 consumer, - final Map cache) { + final Map cache) { return consumer9(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1188,7 +1188,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer10 consumer10( final Consumer10 consumer, - final Map cache) { + final Map cache) { return consumer10(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1316,7 +1316,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer11 consumer11( final Consumer11 consumer, - final Map cache) { + final Map cache) { return consumer11(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1448,7 +1448,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer12 consumer12( final Consumer12 consumer, - final Map cache) { + final Map cache) { return consumer12(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1584,7 +1584,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer13 consumer13( final Consumer13 consumer, - final Map cache) { + final Map cache) { return consumer13(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1724,7 +1724,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer14 consumer14( final Consumer14 consumer, - final Map cache) { + final Map cache) { return consumer14(consumer, MemoizationDefaults::hashCodes, cache); } @@ -1868,7 +1868,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer15 consumer15( final Consumer15 consumer, - final Map cache) { + final Map cache) { return consumer15(consumer, MemoizationDefaults::hashCodes, cache); } @@ -2016,7 +2016,7 @@ public final class MemoizeJool { @CheckReturnValue public static Consumer16 consumer16( final Consumer16 consumer, - final Map cache) { + final Map cache) { return consumer16(consumer, MemoizationDefaults::hashCodes, cache); } @@ -2135,7 +2135,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function0 function0( final Function0 function, - final Map cache) { + final Map cache) { return function0(function, staticKey(), cache); } @@ -2319,7 +2319,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function2 function2( final Function2 function, - final Map cache) { + final Map cache) { return function2(function, MemoizationDefaults::hashCodes, cache); } @@ -2419,7 +2419,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function3 function3( final Function3 function, - final Map cache) { + final Map cache) { return function3(function, MemoizationDefaults::hashCodes, cache); } @@ -2523,7 +2523,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function4 function4( final Function4 function, - final Map cache) { + final Map cache) { return function4(function, MemoizationDefaults::hashCodes, cache); } @@ -2631,7 +2631,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function5 function5( final Function5 function, - final Map cache) { + final Map cache) { return function5(function, MemoizationDefaults::hashCodes, cache); } @@ -2743,7 +2743,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function6 function6( final Function6 function, - final Map cache) { + final Map cache) { return function6(function, MemoizationDefaults::hashCodes, cache); } @@ -2859,7 +2859,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function7 function7( final Function7 function, - final Map cache) { + final Map cache) { return function7(function, MemoizationDefaults::hashCodes, cache); } @@ -2979,7 +2979,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function8 function8( final Function8 function, - final Map cache) { + final Map cache) { return function8(function, MemoizationDefaults::hashCodes, cache); } @@ -3103,7 +3103,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function9 function9( final Function9 function, - final Map cache) { + final Map cache) { return function9(function, MemoizationDefaults::hashCodes, cache); } @@ -3231,7 +3231,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function10 function10( final Function10 function, - final Map cache) { + final Map cache) { return function10(function, MemoizationDefaults::hashCodes, cache); } @@ -3363,7 +3363,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function11 function11( final Function11 function, - final Map cache) { + final Map cache) { return function11(function, MemoizationDefaults::hashCodes, cache); } @@ -3499,7 +3499,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function12 function12( final Function12 function, - final Map cache) { + final Map cache) { return function12(function, MemoizationDefaults::hashCodes, cache); } @@ -3639,7 +3639,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function13 function13( final Function13 function, - final Map cache) { + final Map cache) { return function13(function, MemoizationDefaults::hashCodes, cache); } @@ -3783,7 +3783,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function14 function14( final Function14 function, - final Map cache) { + final Map cache) { return function14(function, MemoizationDefaults::hashCodes, cache); } @@ -3931,7 +3931,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function15 function15( final Function15 function, - final Map cache) { + final Map cache) { return function15(function, MemoizationDefaults::hashCodes, cache); } @@ -4083,7 +4083,7 @@ public final class MemoizeJool { @CheckReturnValue public static Function16 function16( final Function16 function, - final Map cache) { + final Map cache) { return function16(function, MemoizationDefaults::hashCodes, cache); } diff --git a/memoization-lambda/src/main/java/wtf/metio/memoization/lambda/MemoizeLambda.java b/memoization-lambda/src/main/java/wtf/metio/memoization/lambda/MemoizeLambda.java index fce222e..c1b123d 100644 --- a/memoization-lambda/src/main/java/wtf/metio/memoization/lambda/MemoizeLambda.java +++ b/memoization-lambda/src/main/java/wtf/metio/memoization/lambda/MemoizeLambda.java @@ -98,7 +98,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn0 fn0( final Fn0 function, - final Map cache) { + final Map cache) { return fn0(function, staticKey(), cache); } @@ -189,7 +189,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn1 fn1( final Fn1 function, - final Map cache) { + final Map cache) { return fn1(function, MemoizationDefaults::hashCodes, cache); } @@ -284,7 +284,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn2 fn2( final Fn2 function, - final Map cache) { + final Map cache) { return fn2(function, MemoizationDefaults::hashCodes, cache); } @@ -383,7 +383,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn3 fn3( final Fn3 function, - final Map cache) { + final Map cache) { return fn3(function, MemoizationDefaults::hashCodes, cache); } @@ -487,7 +487,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn4 fn4( final Fn4 function, - final Map cache) { + final Map cache) { return fn4(function, MemoizationDefaults::hashCodes, cache); } @@ -595,7 +595,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn5 fn5( final Fn5 function, - final Map cache) { + final Map cache) { return fn5(function, MemoizationDefaults::hashCodes, cache); } @@ -707,7 +707,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn6 fn6( final Fn6 function, - final Map cache) { + final Map cache) { return fn6(function, MemoizationDefaults::hashCodes, cache); } @@ -823,7 +823,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn7 fn7( final Fn7 function, - final Map cache) { + final Map cache) { return fn7(function, MemoizationDefaults::hashCodes, cache); } @@ -943,7 +943,7 @@ public final class MemoizeLambda { @CheckReturnValue public static Fn8 fn8( final Fn8 function, - final Map cache) { + final Map cache) { return fn8(function, MemoizationDefaults::hashCodes, cache); } diff --git a/memoization-rxjava/src/main/java/wtf/metio/memoization/rxjava/MemoizeRx.java b/memoization-rxjava/src/main/java/wtf/metio/memoization/rxjava/MemoizeRx.java index 5b99f9d..520fe46 100644 --- a/memoization-rxjava/src/main/java/wtf/metio/memoization/rxjava/MemoizeRx.java +++ b/memoization-rxjava/src/main/java/wtf/metio/memoization/rxjava/MemoizeRx.java @@ -106,8 +106,8 @@ public final class MemoizeRx { @CheckReturnValue public static Action action( final Action action, - final Map cache) { - return action(action, () -> "SUPPLIED", cache); + final Map cache) { + return action(action, () -> 1, cache); } /** @@ -191,8 +191,8 @@ public final class MemoizeRx { @CheckReturnValue public static Cancellable cancellable( final Cancellable cancellable, - final Map cache) { - return cancellable(cancellable, () -> "SUPPLIED", cache); + final Map cache) { + return cancellable(cancellable, () -> 1, cache); } /** @@ -361,8 +361,8 @@ public final class MemoizeRx { @CheckReturnValue public static BooleanSupplier booleanSupplier( final BooleanSupplier supplier, - final Map cache) { - return booleanSupplier(supplier, () -> "SUPPLIED", cache); + final Map cache) { + return booleanSupplier(supplier, () -> 1, cache); } /** @@ -548,7 +548,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function3 function3( final Function3 function, - final Map cache) { + final Map cache) { return function3(function, MemoizationDefaults::hashCodes, cache); } @@ -652,7 +652,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function4 function4( final Function4 function, - final Map cache) { + final Map cache) { return function4(function, MemoizationDefaults::hashCodes, cache); } @@ -760,7 +760,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function5 function5( final Function5 function, - final Map cache) { + final Map cache) { return function5(function, MemoizationDefaults::hashCodes, cache); } @@ -872,7 +872,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function6 function6( final Function6 function, - final Map cache) { + final Map cache) { return function6(function, MemoizationDefaults::hashCodes, cache); } @@ -988,7 +988,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function7 function7( final Function7 function, - final Map cache) { + final Map cache) { return function7(function, MemoizationDefaults::hashCodes, cache); } @@ -1108,7 +1108,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function8 function8( final Function8 function, - final Map cache) { + final Map cache) { return function8(function, MemoizationDefaults::hashCodes, cache); } @@ -1232,7 +1232,7 @@ public final class MemoizeRx { @CheckReturnValue public static Function9 function9( final Function9 function, - final Map cache) { + final Map cache) { return function9(function, MemoizationDefaults::hashCodes, cache); } @@ -1517,8 +1517,8 @@ public final class MemoizeRx { @CheckReturnValue public static Supplier supplier( final Supplier supplier, - final Map cache) { - return supplier(supplier, () -> "SUPPLIED", asConcurrentMap(cache)); + final Map cache) { + return supplier(supplier, () -> 1, asConcurrentMap(cache)); } /** @@ -1721,7 +1721,7 @@ public final class MemoizeRx { @CheckReturnValue public static BiPredicate biPredicate( final BiPredicate predicate, - final Map cache) { + final Map cache) { return biPredicate(predicate, MemoizationDefaults::hashCodes, cache); } @@ -1818,7 +1818,7 @@ public final class MemoizeRx { @CheckReturnValue public static BiFunction biFunction( final BiFunction biFunction, - final Map cache) { + final Map cache) { return biFunction(biFunction, MemoizationDefaults::hashCodes, cache); } @@ -1912,7 +1912,7 @@ public final class MemoizeRx { @CheckReturnValue public static BiConsumer biConsumer( final BiConsumer biConsumer, - final Map cache) { + final Map cache) { return biConsumer(biConsumer, MemoizationDefaults::hashCodes, cache); } -- 2.11.4.GIT