Class LambdaFactory

java.lang.Object
org.lanternpowered.lmbda.LambdaFactory

public final class LambdaFactory
extends java.lang.Object
A factory to create lambda functions from a given MethodHandle.
  • Method Summary

    Modifier and Type Method Description
    static <@NonNull T>
    T
    create​(@NonNull LambdaType<@NonNull T> lambdaType, @NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a lambda for the given MethodHandle implementing the LambdaType.
    static <T,​ U> @NonNull java.util.function.BiConsumer<T,​U> createBiConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a BiConsumer for the given MethodHandle.
    static <T,​ U,​ R> @NonNull java.util.function.BiFunction<T,​U,​R> createBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a BiFunction for the given MethodHandle.
    static <T> @NonNull java.util.function.BinaryOperator<T> createBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a BinaryOperator for the given MethodHandle.
    static <T,​ U> @NonNull java.util.function.BiPredicate<T,​U> createBiPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a Predicate for the given MethodHandle.
    static @NonNull java.util.function.BooleanSupplier createBooleanSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a BooleanSupplier for the given MethodHandle.
    static <T> @NonNull java.util.function.Consumer<T> createConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a Consumer for the given MethodHandle.
    static @NonNull java.util.function.DoubleBinaryOperator createDoubleBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleBinaryOperator for the given MethodHandle.
    static @NonNull java.util.function.DoubleConsumer createDoubleConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleConsumer for the given MethodHandle.
    static <R> @NonNull java.util.function.DoubleFunction<R> createDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleFunction for the given MethodHandle.
    static @NonNull java.util.function.DoublePredicate createDoublePredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoublePredicate for the given MethodHandle.
    static @NonNull java.util.function.DoubleSupplier createDoubleSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleSupplier for the given MethodHandle.
    static @NonNull java.util.function.DoubleToIntFunction createDoubleToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleToIntFunction for the given MethodHandle.
    static @NonNull java.util.function.DoubleToLongFunction createDoubleToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleToLongFunction for the given MethodHandle.
    static @NonNull java.util.function.DoubleUnaryOperator createDoubleUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a DoubleUnaryOperator for the given MethodHandle.
    static <T,​ R> @NonNull java.util.function.Function<T,​R> createFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a Function for the given MethodHandle.
    static @NonNull java.util.function.IntBinaryOperator createIntBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntBinaryOperator for the given MethodHandle.
    static @NonNull java.util.function.IntConsumer createIntConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntConsumer for the given MethodHandle.
    static <R> @NonNull java.util.function.IntFunction<R> createIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntFunction for the given MethodHandle.
    static @NonNull java.util.function.IntPredicate createIntPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntPredicate for the given MethodHandle.
    static @NonNull java.util.function.IntSupplier createIntSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntSupplier for the given MethodHandle.
    static @NonNull java.util.function.IntToDoubleFunction createIntToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntToDoubleFunction for the given MethodHandle.
    static @NonNull java.util.function.IntToLongFunction createIntToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntToLongFunction for the given MethodHandle.
    static @NonNull java.util.function.IntUnaryOperator createIntUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a IntUnaryOperator for the given MethodHandle.
    static @NonNull java.util.function.LongBinaryOperator createLongBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongBinaryOperator for the given MethodHandle.
    static @NonNull java.util.function.LongConsumer createLongConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongConsumer for the given MethodHandle.
    static <R> @NonNull java.util.function.LongFunction<R> createLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongFunction for the given MethodHandle.
    static @NonNull java.util.function.LongPredicate createLongPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongPredicate for the given MethodHandle.
    static @NonNull java.util.function.LongSupplier createLongSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongSupplier for the given MethodHandle.
    static @NonNull java.util.function.LongToDoubleFunction createLongToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongToDoubleFunction for the given MethodHandle.
    static @NonNull java.util.function.LongToIntFunction createLongToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongToIntFunction for the given MethodHandle.
    static @NonNull java.util.function.LongUnaryOperator createLongUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a LongUnaryOperator for the given MethodHandle.
    static <T> @NonNull java.util.function.ObjDoubleConsumer<T> createObjDoubleConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ObjDoubleConsumer for the given MethodHandle.
    static <T> @NonNull java.util.function.ObjIntConsumer<T> createObjIntConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ObjIntConsumer for the given MethodHandle.
    static <T> @NonNull java.util.function.ObjLongConsumer<T> createObjLongConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ObjLongConsumer for the given MethodHandle.
    static <T> @NonNull java.util.function.Predicate<T> createPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a Predicate for the given MethodHandle.
    static <T> @NonNull java.util.function.Supplier<T> createSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a Supplier for the given MethodHandle.
    static <T,​ U> @NonNull java.util.function.ToDoubleBiFunction<T,​U> createToDoubleBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToDoubleBiFunction for the given MethodHandle.
    static <T> @NonNull java.util.function.ToDoubleFunction<T> createToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToDoubleFunction for the given MethodHandle.
    static <T,​ U> @NonNull java.util.function.ToIntBiFunction<T,​U> createToIntBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToIntBiFunction for the given MethodHandle.
    static <T> @NonNull java.util.function.ToIntFunction<T> createToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToIntFunction for the given MethodHandle.
    static <T,​ U> @NonNull java.util.function.ToLongBiFunction<T,​U> createToLongBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToLongBiFunction for the given MethodHandle.
    static <T> @NonNull java.util.function.ToLongFunction<T> createToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a ToLongFunction for the given MethodHandle.
    static <T> @NonNull java.util.function.UnaryOperator<T> createUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
    Attempts to create a UnaryOperator for the given MethodHandle.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createBinaryOperator

      public static <T> @NonNull java.util.function.BinaryOperator<T> createBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a BinaryOperator for the given MethodHandle.
      Type Parameters:
      T - The target type of the binary operator
      Parameters:
      methodHandle - The method handle
      Returns:
      The created binary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createIntBinaryOperator

      public static @NonNull java.util.function.IntBinaryOperator createIntBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntBinaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int binary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleBinaryOperator

      public static @NonNull java.util.function.DoubleBinaryOperator createDoubleBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleBinaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double binary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createLongBinaryOperator

      public static @NonNull java.util.function.LongBinaryOperator createLongBinaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongBinaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long binary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createUnaryOperator

      public static <T> @NonNull java.util.function.UnaryOperator<T> createUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a UnaryOperator for the given MethodHandle.
      Type Parameters:
      T - The target type of the unary operator
      Parameters:
      methodHandle - The method handle
      Returns:
      The created unary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createIntUnaryOperator

      public static @NonNull java.util.function.IntUnaryOperator createIntUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntUnaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int unary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleUnaryOperator

      public static @NonNull java.util.function.DoubleUnaryOperator createDoubleUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleUnaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double unary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createLongUnaryOperator

      public static @NonNull java.util.function.LongUnaryOperator createLongUnaryOperator​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongUnaryOperator for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long unary operator
      See Also:
      create(LambdaType, MethodHandle)
    • createBiPredicate

      public static <T,​ U> @NonNull java.util.function.BiPredicate<T,​U> createBiPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a Predicate for the given MethodHandle.
      Type Parameters:
      T - The first input type of the predicate
      U - The second input type of the predicate
      Parameters:
      methodHandle - The method handle
      Returns:
      The created bi predicate
      See Also:
      create(LambdaType, MethodHandle)
    • createPredicate

      public static <T> @NonNull java.util.function.Predicate<T> createPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a Predicate for the given MethodHandle.
      Type Parameters:
      T - The input type of the predicate
      Parameters:
      methodHandle - The method handle
      Returns:
      The created predicate
      See Also:
      create(LambdaType, MethodHandle)
    • createIntPredicate

      public static @NonNull java.util.function.IntPredicate createIntPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntPredicate for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int predicate
      See Also:
      create(LambdaType, MethodHandle)
    • createDoublePredicate

      public static @NonNull java.util.function.DoublePredicate createDoublePredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoublePredicate for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double predicate
      See Also:
      create(LambdaType, MethodHandle)
    • createLongPredicate

      public static @NonNull java.util.function.LongPredicate createLongPredicate​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongPredicate for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long predicate
      See Also:
      create(LambdaType, MethodHandle)
    • createBiConsumer

      public static <T,​ U> @NonNull java.util.function.BiConsumer<T,​U> createBiConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a BiConsumer for the given MethodHandle.
      Type Parameters:
      T - The first input type of the consumer
      U - The second input type of the consumer
      Parameters:
      methodHandle - The method handle
      Returns:
      The created bi consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createObjIntConsumer

      public static <T> @NonNull java.util.function.ObjIntConsumer<T> createObjIntConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ObjIntConsumer for the given MethodHandle.
      Type Parameters:
      T - The first input type of the consumer
      Parameters:
      methodHandle - The method handle
      Returns:
      The created obj int consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createObjDoubleConsumer

      public static <T> @NonNull java.util.function.ObjDoubleConsumer<T> createObjDoubleConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ObjDoubleConsumer for the given MethodHandle.
      Type Parameters:
      T - The first input type of the consumer
      Parameters:
      methodHandle - The method handle
      Returns:
      The created obj double consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createObjLongConsumer

      public static <T> @NonNull java.util.function.ObjLongConsumer<T> createObjLongConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ObjLongConsumer for the given MethodHandle.
      Type Parameters:
      T - The first input type of the consumer
      Parameters:
      methodHandle - The method handle
      Returns:
      The created obj long consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createConsumer

      public static <T> @NonNull java.util.function.Consumer<T> createConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a Consumer for the given MethodHandle.
      Type Parameters:
      T - The input type of the consumer
      Parameters:
      methodHandle - The method handle
      Returns:
      The created consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createIntConsumer

      public static @NonNull java.util.function.IntConsumer createIntConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntConsumer for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleConsumer

      public static @NonNull java.util.function.DoubleConsumer createDoubleConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleConsumer for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createLongConsumer

      public static @NonNull java.util.function.LongConsumer createLongConsumer​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongConsumer for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long consumer
      See Also:
      create(LambdaType, MethodHandle)
    • createSupplier

      public static <T> @NonNull java.util.function.Supplier<T> createSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a Supplier for the given MethodHandle.
      Type Parameters:
      T - The result type of the supplier
      Parameters:
      methodHandle - The method handle
      Returns:
      The created supplier
      See Also:
      create(LambdaType, MethodHandle)
    • createIntSupplier

      public static @NonNull java.util.function.IntSupplier createIntSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntSupplier for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int supplier
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleSupplier

      public static @NonNull java.util.function.DoubleSupplier createDoubleSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleSupplier for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double supplier
      See Also:
      create(LambdaType, MethodHandle)
    • createLongSupplier

      public static @NonNull java.util.function.LongSupplier createLongSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongSupplier for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long supplier
      See Also:
      create(LambdaType, MethodHandle)
    • createBooleanSupplier

      public static @NonNull java.util.function.BooleanSupplier createBooleanSupplier​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a BooleanSupplier for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created boolean supplier
      See Also:
      create(LambdaType, MethodHandle)
    • createBiFunction

      public static <T,​ U,​ R> @NonNull java.util.function.BiFunction<T,​U,​R> createBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a BiFunction for the given MethodHandle.
      Type Parameters:
      T - The first input type of the function
      U - The second input type of the function
      R - The result type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created bi function
      See Also:
      create(LambdaType, MethodHandle)
    • createToIntBiFunction

      public static <T,​ U> @NonNull java.util.function.ToIntBiFunction<T,​U> createToIntBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToIntBiFunction for the given MethodHandle.
      Type Parameters:
      T - The first input type of the function
      U - The second input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to int bi function
      See Also:
      create(LambdaType, MethodHandle)
    • createToDoubleBiFunction

      public static <T,​ U> @NonNull java.util.function.ToDoubleBiFunction<T,​U> createToDoubleBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToDoubleBiFunction for the given MethodHandle.
      Type Parameters:
      T - The first input type of the function
      U - The second input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to double bi function
      See Also:
      create(LambdaType, MethodHandle)
    • createToLongBiFunction

      public static <T,​ U> @NonNull java.util.function.ToLongBiFunction<T,​U> createToLongBiFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToLongBiFunction for the given MethodHandle.
      Type Parameters:
      T - The first input type of the function
      U - The second input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to long bi function
      See Also:
      create(LambdaType, MethodHandle)
    • createFunction

      public static <T,​ R> @NonNull java.util.function.Function<T,​R> createFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a Function for the given MethodHandle.
      Type Parameters:
      T - The input type of the function
      R - The result type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created function
      See Also:
      create(LambdaType, MethodHandle)
    • createIntFunction

      public static <R> @NonNull java.util.function.IntFunction<R> createIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntFunction for the given MethodHandle.
      Type Parameters:
      R - The result type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int function
      See Also:
      create(LambdaType, MethodHandle)
    • createToIntFunction

      public static <T> @NonNull java.util.function.ToIntFunction<T> createToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToIntFunction for the given MethodHandle.
      Type Parameters:
      T - The input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to int function
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleFunction

      public static <R> @NonNull java.util.function.DoubleFunction<R> createDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleFunction for the given MethodHandle.
      Type Parameters:
      R - The result type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double function
      See Also:
      create(LambdaType, MethodHandle)
    • createToDoubleFunction

      public static <T> @NonNull java.util.function.ToDoubleFunction<T> createToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToDoubleFunction for the given MethodHandle.
      Type Parameters:
      T - The input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to double function
      See Also:
      create(LambdaType, MethodHandle)
    • createLongFunction

      public static <R> @NonNull java.util.function.LongFunction<R> createLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongFunction for the given MethodHandle.
      Type Parameters:
      R - The result type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long function
      See Also:
      create(LambdaType, MethodHandle)
    • createToLongFunction

      public static <T> @NonNull java.util.function.ToLongFunction<T> createToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a ToLongFunction for the given MethodHandle.
      Type Parameters:
      T - The input type of the function
      Parameters:
      methodHandle - The method handle
      Returns:
      The created to long function
      See Also:
      create(LambdaType, MethodHandle)
    • createIntToLongFunction

      public static @NonNull java.util.function.IntToLongFunction createIntToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntToLongFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int to long function
      See Also:
      create(LambdaType, MethodHandle)
    • createIntToDoubleFunction

      public static @NonNull java.util.function.IntToDoubleFunction createIntToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a IntToDoubleFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created int to double function
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleToIntFunction

      public static @NonNull java.util.function.DoubleToIntFunction createDoubleToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleToIntFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double to int function
      See Also:
      create(LambdaType, MethodHandle)
    • createDoubleToLongFunction

      public static @NonNull java.util.function.DoubleToLongFunction createDoubleToLongFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a DoubleToLongFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created double to long function
      See Also:
      create(LambdaType, MethodHandle)
    • createLongToIntFunction

      public static @NonNull java.util.function.LongToIntFunction createLongToIntFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongToIntFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long to int function
      See Also:
      create(LambdaType, MethodHandle)
    • createLongToDoubleFunction

      public static @NonNull java.util.function.LongToDoubleFunction createLongToDoubleFunction​(@NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a LongToDoubleFunction for the given MethodHandle.
      Parameters:
      methodHandle - The method handle
      Returns:
      The created long to double function
      See Also:
      create(LambdaType, MethodHandle)
    • create

      public static <@NonNull T> T create​(@NonNull LambdaType<@NonNull T> lambdaType, @NonNull java.lang.invoke.MethodHandle methodHandle)
      Attempts to create a lambda for the given MethodHandle implementing the LambdaType.

      This method can also throw a IllegalAccessException if the default or provided MethodHandles.Lookup doesn't have proper access to implement the LambdaType. This exception is thrown as an unchecked exception for convenience.

      Type Parameters:
      T - The functional interface type
      Parameters:
      lambdaType - The lambda type to implement
      methodHandle - The method handle that will be executed by the functional interface
      Returns:
      The constructed function