Package org.lanternpowered.lmbda
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>
Tcreate(@NonNull LambdaType<@NonNull T> lambdaType, @NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create a lambda for the givenMethodHandleimplementing theLambdaType.static <T, U> @NonNull java.util.function.BiConsumer<T,U>createBiConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aBiConsumerfor the givenMethodHandle.static <T, U, R> @NonNull java.util.function.BiFunction<T,U,R>createBiFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aBiFunctionfor the givenMethodHandle.static <T> @NonNull java.util.function.BinaryOperator<T>createBinaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aBinaryOperatorfor the givenMethodHandle.static <T, U> @NonNull java.util.function.BiPredicate<T,U>createBiPredicate(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aPredicatefor the givenMethodHandle.static @NonNull java.util.function.BooleanSuppliercreateBooleanSupplier(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aBooleanSupplierfor the givenMethodHandle.static <T> @NonNull java.util.function.Consumer<T>createConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aConsumerfor the givenMethodHandle.static @NonNull java.util.function.DoubleBinaryOperatorcreateDoubleBinaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleBinaryOperatorfor the givenMethodHandle.static @NonNull java.util.function.DoubleConsumercreateDoubleConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleConsumerfor the givenMethodHandle.static <R> @NonNull java.util.function.DoubleFunction<R>createDoubleFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleFunctionfor the givenMethodHandle.static @NonNull java.util.function.DoublePredicatecreateDoublePredicate(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoublePredicatefor the givenMethodHandle.static @NonNull java.util.function.DoubleSuppliercreateDoubleSupplier(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleSupplierfor the givenMethodHandle.static @NonNull java.util.function.DoubleToIntFunctioncreateDoubleToIntFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleToIntFunctionfor the givenMethodHandle.static @NonNull java.util.function.DoubleToLongFunctioncreateDoubleToLongFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleToLongFunctionfor the givenMethodHandle.static @NonNull java.util.function.DoubleUnaryOperatorcreateDoubleUnaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aDoubleUnaryOperatorfor the givenMethodHandle.static <T, R> @NonNull java.util.function.Function<T,R>createFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aFunctionfor the givenMethodHandle.static @NonNull java.util.function.IntBinaryOperatorcreateIntBinaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntBinaryOperatorfor the givenMethodHandle.static @NonNull java.util.function.IntConsumercreateIntConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntConsumerfor the givenMethodHandle.static <R> @NonNull java.util.function.IntFunction<R>createIntFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntFunctionfor the givenMethodHandle.static @NonNull java.util.function.IntPredicatecreateIntPredicate(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntPredicatefor the givenMethodHandle.static @NonNull java.util.function.IntSuppliercreateIntSupplier(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntSupplierfor the givenMethodHandle.static @NonNull java.util.function.IntToDoubleFunctioncreateIntToDoubleFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntToDoubleFunctionfor the givenMethodHandle.static @NonNull java.util.function.IntToLongFunctioncreateIntToLongFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntToLongFunctionfor the givenMethodHandle.static @NonNull java.util.function.IntUnaryOperatorcreateIntUnaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aIntUnaryOperatorfor the givenMethodHandle.static @NonNull java.util.function.LongBinaryOperatorcreateLongBinaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongBinaryOperatorfor the givenMethodHandle.static @NonNull java.util.function.LongConsumercreateLongConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongConsumerfor the givenMethodHandle.static <R> @NonNull java.util.function.LongFunction<R>createLongFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongFunctionfor the givenMethodHandle.static @NonNull java.util.function.LongPredicatecreateLongPredicate(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongPredicatefor the givenMethodHandle.static @NonNull java.util.function.LongSuppliercreateLongSupplier(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongSupplierfor the givenMethodHandle.static @NonNull java.util.function.LongToDoubleFunctioncreateLongToDoubleFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongToDoubleFunctionfor the givenMethodHandle.static @NonNull java.util.function.LongToIntFunctioncreateLongToIntFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongToIntFunctionfor the givenMethodHandle.static @NonNull java.util.function.LongUnaryOperatorcreateLongUnaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aLongUnaryOperatorfor the givenMethodHandle.static <T> @NonNull java.util.function.ObjDoubleConsumer<T>createObjDoubleConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aObjDoubleConsumerfor the givenMethodHandle.static <T> @NonNull java.util.function.ObjIntConsumer<T>createObjIntConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aObjIntConsumerfor the givenMethodHandle.static <T> @NonNull java.util.function.ObjLongConsumer<T>createObjLongConsumer(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aObjLongConsumerfor the givenMethodHandle.static <T> @NonNull java.util.function.Predicate<T>createPredicate(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aPredicatefor the givenMethodHandle.static <T> @NonNull java.util.function.Supplier<T>createSupplier(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aSupplierfor the givenMethodHandle.static <T, U> @NonNull java.util.function.ToDoubleBiFunction<T,U>createToDoubleBiFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToDoubleBiFunctionfor the givenMethodHandle.static <T> @NonNull java.util.function.ToDoubleFunction<T>createToDoubleFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToDoubleFunctionfor the givenMethodHandle.static <T, U> @NonNull java.util.function.ToIntBiFunction<T,U>createToIntBiFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToIntBiFunctionfor the givenMethodHandle.static <T> @NonNull java.util.function.ToIntFunction<T>createToIntFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToIntFunctionfor the givenMethodHandle.static <T, U> @NonNull java.util.function.ToLongBiFunction<T,U>createToLongBiFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToLongBiFunctionfor the givenMethodHandle.static <T> @NonNull java.util.function.ToLongFunction<T>createToLongFunction(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aToLongFunctionfor the givenMethodHandle.static <T> @NonNull java.util.function.UnaryOperator<T>createUnaryOperator(@NonNull java.lang.invoke.MethodHandle methodHandle)Attempts to create aUnaryOperatorfor the givenMethodHandle.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 aBinaryOperatorfor the givenMethodHandle.- 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 aIntBinaryOperatorfor the givenMethodHandle.- 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 aDoubleBinaryOperatorfor the givenMethodHandle.- 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 aLongBinaryOperatorfor the givenMethodHandle.- 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 aUnaryOperatorfor the givenMethodHandle.- 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 aIntUnaryOperatorfor the givenMethodHandle.- 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 aDoubleUnaryOperatorfor the givenMethodHandle.- 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 aLongUnaryOperatorfor the givenMethodHandle.- 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 aPredicatefor the givenMethodHandle.- Type Parameters:
T- The first input type of the predicateU- 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 aPredicatefor the givenMethodHandle.- 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 aIntPredicatefor the givenMethodHandle.- 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 aDoublePredicatefor the givenMethodHandle.- 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 aLongPredicatefor the givenMethodHandle.- 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 aBiConsumerfor the givenMethodHandle.- Type Parameters:
T- The first input type of the consumerU- 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 aObjIntConsumerfor the givenMethodHandle.- 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 aObjDoubleConsumerfor the givenMethodHandle.- 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 aObjLongConsumerfor the givenMethodHandle.- 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 aConsumerfor the givenMethodHandle.- 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 aIntConsumerfor the givenMethodHandle.- 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 aDoubleConsumerfor the givenMethodHandle.- 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 aLongConsumerfor the givenMethodHandle.- 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 aSupplierfor the givenMethodHandle.- 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 aIntSupplierfor the givenMethodHandle.- 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 aDoubleSupplierfor the givenMethodHandle.- 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 aLongSupplierfor the givenMethodHandle.- 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 aBooleanSupplierfor the givenMethodHandle.- 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 aBiFunctionfor the givenMethodHandle.- Type Parameters:
T- The first input type of the functionU- The second input type of the functionR- 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 aToIntBiFunctionfor the givenMethodHandle.- Type Parameters:
T- The first input type of the functionU- 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 aToDoubleBiFunctionfor the givenMethodHandle.- Type Parameters:
T- The first input type of the functionU- 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 aToLongBiFunctionfor the givenMethodHandle.- Type Parameters:
T- The first input type of the functionU- 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 aFunctionfor the givenMethodHandle.- Type Parameters:
T- The input type of the functionR- 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 aIntFunctionfor the givenMethodHandle.- 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 aToIntFunctionfor the givenMethodHandle.- 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 aDoubleFunctionfor the givenMethodHandle.- 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 aToDoubleFunctionfor the givenMethodHandle.- 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 aLongFunctionfor the givenMethodHandle.- 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 aToLongFunctionfor the givenMethodHandle.- 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 aIntToLongFunctionfor the givenMethodHandle.- 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 aIntToDoubleFunctionfor the givenMethodHandle.- 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 aDoubleToIntFunctionfor the givenMethodHandle.- 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 aDoubleToLongFunctionfor the givenMethodHandle.- 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 aLongToIntFunctionfor the givenMethodHandle.- 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 aLongToDoubleFunctionfor the givenMethodHandle.- 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 givenMethodHandleimplementing theLambdaType.This method can also throw a
IllegalAccessExceptionif the default or providedMethodHandles.Lookupdoesn't have proper access to implement theLambdaType. This exception is thrown as an unchecked exception for convenience.- Type Parameters:
T- The functional interface type- Parameters:
lambdaType- The lambda type to implementmethodHandle- The method handle that will be executed by the functional interface- Returns:
- The constructed function
-