package com.github.sebhoss.utils.memoization.shared;

import java.util.Objects;
import java.util.function.BiFunction;
import java.util.function.Supplier;

/**
 *
 */
public final class MemoizationDefaults {

    private MemoizationDefaults() {
        // utility class
    }

    /**
     * @return The default key supplier used throughout the library.
     */
    public static Supplier<String> defaultKeySupplier() {
        return () -> "SUPPLIED"; //$NON-NLS-1$
    }

    /**
     * @return The default key function used throughout the library.
     */
    public static <T, U> BiFunction<T, U, String> hashCodeKeyFunction() {
        return (first, second) -> {
            final int firstHashCode = Objects.hashCode(first);
            final int secondHashCode = Objects.hashCode(second);
            return firstHashCode + " " + secondHashCode; //$NON-NLS-1$
        };
    }

}

@@ -154,16 +154,54 @@
 %0A%0A/**%0A *
+ Defaults used throughout the library.
 %0A */%0Apub

add missing javadocs