@FunctionalInterface public interface LOiFunction<T,R> extends MetaFunction, MetaInterface.NonThrowing, OiFunction<T,aType.a<R>>, Codomain<aType.a<R>>, Domain2<aType.a<T>,aType.aInt>
Non-throwing functional interface (lambda) LOiFunction for Java 8.
Type: function
Domain (lvl: 2): T a1,int a2
Co-domain: R
Special case of function that corresponds to expressions like (list, index) -> List::get
| Modifier and Type | Interface and Description |
|---|---|
static interface |
LOiFunction.LIntObjFunc<T,R>
Permutation of LOiFunction for method references.
|
static class |
LOiFunction.LOiFunctionSingle<T,R> |
MetaInterface.NonThrowing, MetaInterface.Throwing<X>| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
static LSupplier<String> |
NULL_VALUE_MESSAGE_SUPPLIER |
| Modifier and Type | Method and Description |
|---|---|
default LOiFunction<T,R> |
after(LConsumer<? super R> after) |
default R |
apply(T a1,
int a2) |
default R |
apply(T a1,
int a2,
ExWF<RuntimeException> exF) |
default R |
apply(T a1,
int a2,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <T,R> LOiFunction<T,R> |
apply1st(LFunction<T,R> func)
Captures single parameter function into this interface where only 1st parameter will be used.
|
static <T,R> LOiFunction<T,R> |
apply2nd(LIntFunction<R> func)
Captures single parameter function into this interface where only 2nd parameter will be used.
|
default R |
applyThen(T a1,
int a2,
LFunction<Throwable,R> handler) |
R |
applyX(T a1,
int a2)
Implement this, but call apply(T a1,int a2)
|
default LOiFunction<T,R> |
before(LObjIntConsumer<? super T> before) |
static <T,R> R |
call(T a1,
int a2,
LOiFunction<T,R> lambda) |
default LSupplier<R> |
capture(T a1,
int a2)
Captures arguments but delays the evaluation.
|
default <V2,V3> LOiFunction<V2,V3> |
cast()
Cast that replace generics.
|
static <V2,V3,T,R> |
cast(LOiFunction<T,R> function)
Cast that replace generics.
|
default <V1> LOiFunction<V1,R> |
compose(LFunction<? super V1,? extends T> before1,
LIntUnaryOperator before2)
Allows to manipulate the domain of the function.
|
static <V1,T,R> LOiFunction<V1,R> |
composed(LFunction<? super V1,? extends T> before1,
LIntUnaryOperator before2,
LOiFunction<T,R> after) |
static <V1,V2,T,R> |
composed(LFunction<? super V1,? extends T> before1,
LToIntFunction<? super V2> before2,
LOiFunction<T,R> after) |
static <T,R> LOiFunction<T,R> |
constant(R r)
Creates function that always returns the same value.
|
static <T,R> LOiFunction<T,R> |
failSafe(LOiFunction<T,R> func,
LOiFunction<T,R> failSafe) |
default R |
failSafeApply(T a1,
int a2,
LOiFunction<T,R> failSafe) |
static <T,R> R |
failSafeApply(T a1,
int a2,
LOiFunction<T,R> func,
LOiFunction<T,R> failSafe) |
default <C1,C2> void |
forEach(IndexedRead<C1,aType.a<T>> ia1,
C1 source1,
IndexedRead<C2,aType.aInt> ia2,
C2 source2,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static <T,R> void |
fromTill(int min_a2,
int max_a2,
T a1,
LOiFunction<T,R> func)
From-To.
|
static <T,R> void |
fromTo(int min_a2,
int max_a2,
T a1,
LOiFunction<T,R> func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LOiFunction<T,R> |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default R |
handlingApply(T a1,
int a2,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static <T,R> R |
handlingApply(T a1,
int a2,
LOiFunction<T,R> func,
HandlingInstructions<Throwable,RuntimeException> handling) |
static <T,R> LOiFunction.LIntObjFunc<T,R> |
intObjFunc(LOiFunction.LIntObjFunc<T,R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
default <C1,C2,I2> void |
iterate(IndexedRead<C1,aType.a<T>> ia1,
C1 source1,
SequentialRead<C2,I2,aType.aInt> sa2,
C2 source2,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default <C1,I1,C2> void |
iterate(SequentialRead<C1,I1,aType.a<T>> sa1,
C1 source1,
IndexedRead<C2,aType.aInt> ia2,
C2 source2,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default <C1,I1,C2,I2> |
iterate(SequentialRead<C1,I1,aType.a<T>> sa1,
C1 source1,
SequentialRead<C2,I2,aType.aInt> sa2,
C2 source2,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default LIntFunction<R> |
lShrink(LIntFunction<T> left) |
default LIntFunction<R> |
lShrinkc(T a1) |
static <R,T> LIntFunction<R> |
lShrinked(LIntFunction<T> left,
LOiFunction<T,R> func) |
static <R,T> LIntFunction<R> |
lShrinkedc(T a1,
LOiFunction<T,R> func) |
default R |
nestingApply(T a1,
int a2)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default LOiFunction<T,R> |
nonNullable()
Converts to function that makes sure that the result is not null.
|
default R |
nonNullApply(T a1,
int a2)
Function call that ensures the result is not null
|
static <T,R> LOiFunction<T,R> |
oiFunc(LOiFunction<T,R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
default <V1,V2> LBiFunction<V1,V2,R> |
oiFuncCompose(LFunction<? super V1,? extends T> before1,
LToIntFunction<? super V2> before2)
Allows to manipulate the domain of the function.
|
static <T,R> LOiFunction<T,R> |
oiFuncThrowing(ExF<Throwable> exF) |
static <T,R> LOiFunction<T,R> |
oiFuncThrowing(String message,
ExMF<Throwable> exF) |
static <T,R> R |
produce(int a2,
T a1)
Does nothing (LOiFunction.LIntObjFunc) Function
|
static <T,R> R |
produce(T a1,
int a2)
Does nothing (LOiFunction) Function
|
static <T,R> LOiFunction<T,R> |
recursive(LFunction<LOiFunction<T,R>,LOiFunction<T,R>> selfLambda) |
default LFunction<T,R> |
rShrink(LToIntFunction<T> right) |
default LFunction<T,R> |
rShrinkc(int a2) |
static <T,R> LFunction<T,R> |
rShrinked(LToIntFunction<T> right,
LOiFunction<T,R> func) |
static <T,R> LFunction<T,R> |
rShrinkedc(int a2,
LOiFunction<T,R> func) |
static <T,R> LOiFunction<T,R> |
safe()
Safe instance.
|
static <T,R> LOiFunction<T,R> |
safe(LOiFunction<T,R> other)
Safe wrapping.
|
static <T,R> LSupplier<LOiFunction<T,R>> |
safeSupplier()
Safe instance supplier.
|
static <T,R> LSupplier<LOiFunction<T,R>> |
safeSupplier(LSupplier<LOiFunction<T,R>> supplier)
Safe supplier.
|
default R |
shovingApply(T a1,
int a2)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
|
default <V> LOiFunction<T,V> |
then(LFunction<? super R,? extends V> after)
Combines two functions together in a order.
|
default LObjIntConsumer<T> |
thenConsume(LConsumer<? super R> after)
Combines two functions together in a order.
|
default LObjIntPredicate<T> |
thenToBool(LPredicate<? super R> after)
Combines two functions together in a order.
|
default LOiToByteFunction<T> |
thenToByte(LToByteFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToCharFunction<T> |
thenToChar(LToCharFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToDblFunction<T> |
thenToDbl(LToDblFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToFltFunction<T> |
thenToFlt(LToFltFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToIntFunction<T> |
thenToInt(LToIntFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToLongFunction<T> |
thenToLong(LToLongFunction<? super R> after)
Combines two functions together in a order.
|
default LOiToSrtFunction<T> |
thenToSrt(LToSrtFunction<? super R> after)
Combines two functions together in a order.
|
static <T,R> void |
times(int max_a2,
T a1,
LOiFunction<T,R> func)
From-To.
|
static <T,R> R |
tryApply(T a1,
int a2,
LOiFunction<T,R> func) |
static <T,R> R |
tryApply(T a1,
int a2,
LOiFunction<T,R> func,
ExWF<RuntimeException> exF) |
static <T,R> R |
tryApply(T a1,
int a2,
LOiFunction<T,R> func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <T,R> R |
tryApplyThen(T a1,
int a2,
LOiFunction<T,R> func,
LFunction<Throwable,R> handler) |
default LOiFunction<T,R> |
trying(ExWF<RuntimeException> exF) |
default LOiFunction<T,R> |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LOiFunction<T,R> |
tryingThen(LFunction<Throwable,R> handler) |
default R |
tupleApply(LObjIntPair<T> args) |
static <T,R> LOiFunction<T,R> |
uncurry(LFunction<T,LIntFunction<R>> func) |
default LOiFunction |
untyped()
Cast that removes generics.
|
isThrowingisFunctionformatTo, isAction, isConsumer, isOperator, isPredicate, isSupplierstatic final String DESCRIPTION
R applyX(T a1, int a2) throws Throwable
Implement this, but call apply(T a1,int a2)
Throwabledefault R tupleApply(LObjIntPair<T> args)
default R handlingApply(T a1, int a2, HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LOiFunction<T,R> handling(HandlingInstructions<Throwable,RuntimeException> handling)
default R apply(T a1, int a2, @Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default LOiFunction<T,R> trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default R apply(T a1, int a2, @Nonnull ExWF<RuntimeException> exF)
default LOiFunction<T,R> trying(@Nonnull ExWF<RuntimeException> exF)
default R nestingApply(T a1, int a2)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default R shovingApply(T a1, int a2)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static <T,R> R handlingApply(T a1,
int a2,
LOiFunction<T,R> func,
HandlingInstructions<Throwable,RuntimeException> handling)
static <T,R> R tryApply(T a1,
int a2,
LOiFunction<T,R> func)
static <T,R> R tryApply(T a1,
int a2,
LOiFunction<T,R> func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static <T,R> R tryApply(T a1,
int a2,
LOiFunction<T,R> func,
@Nonnull
ExWF<RuntimeException> exF)
static <T,R> R tryApplyThen(T a1,
int a2,
LOiFunction<T,R> func,
@Nonnull
LFunction<Throwable,R> handler)
static <T,R> R failSafeApply(T a1,
int a2,
LOiFunction<T,R> func,
@Nonnull
LOiFunction<T,R> failSafe)
static <T,R> LOiFunction<T,R> failSafe(LOiFunction<T,R> func, @Nonnull LOiFunction<T,R> failSafe)
@Nonnull default R nonNullApply(T a1, int a2)
Function call that ensures the result is not null
@Nonnull default String functionalInterfaceDescription()
Returns description of the functional interface.
functionalInterfaceDescription in interface MetaFunctionalInterfacestatic <T,R> void fromTo(int min_a2,
int max_a2,
T a1,
LOiFunction<T,R> func)
From-To. Intended to be used with non-capturing lambda.
static <T,R> void fromTill(int min_a2,
int max_a2,
T a1,
LOiFunction<T,R> func)
From-To. Intended to be used with non-capturing lambda.
static <T,R> void times(int max_a2,
T a1,
LOiFunction<T,R> func)
From-To. Intended to be used with non-capturing lambda.
default LIntFunction<R> lShrink(LIntFunction<T> left)
default LIntFunction<R> lShrinkc(T a1)
static <R,T> LIntFunction<R> lShrinked(LIntFunction<T> left, LOiFunction<T,R> func)
static <R,T> LIntFunction<R> lShrinkedc(T a1, LOiFunction<T,R> func)
default LFunction<T,R> rShrink(LToIntFunction<T> right)
static <T,R> LFunction<T,R> rShrinked(LToIntFunction<T> right, LOiFunction<T,R> func)
static <T,R> LFunction<T,R> rShrinkedc(int a2, LOiFunction<T,R> func)
static <T,R> LOiFunction<T,R> uncurry(LFunction<T,LIntFunction<R>> func)
default LOiFunction untyped()
Cast that removes generics.
default <V2,V3> LOiFunction<V2,V3> cast()
Cast that replace generics.
static <V2,V3,T,R> LOiFunction<V2,V3> cast(LOiFunction<T,R> function)
Cast that replace generics.
static <T,R> LOiFunction<T,R> constant(R r)
Creates function that always returns the same value.
@Nonnull static <T,R> LOiFunction<T,R> apply1st(@Nonnull LFunction<T,R> func)
Captures single parameter function into this interface where only 1st parameter will be used.
@Nonnull static <T,R> LOiFunction<T,R> apply2nd(@Nonnull LIntFunction<R> func)
Captures single parameter function into this interface where only 2nd parameter will be used.
@Nonnull static <T,R> LOiFunction<T,R> oiFunc(@Nonnull LOiFunction<T,R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
@Nonnull static <T,R> LOiFunction<T,R> recursive(@Nonnull LFunction<LOiFunction<T,R>,LOiFunction<T,R>> selfLambda)
@Nonnull static <T,R> LOiFunction<T,R> oiFuncThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static <T,R> LOiFunction<T,R> oiFuncThrowing(String message, @Nonnull ExMF<Throwable> exF)
@Nonnull static <T,R> LOiFunction.LIntObjFunc<T,R> intObjFunc(@Nonnull LOiFunction.LIntObjFunc<T,R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
static <T,R> R call(T a1,
int a2,
@Nonnull
LOiFunction<T,R> lambda)
@Nonnull static <T,R> LOiFunction<T,R> safe()
Safe instance. That always returns the same value (as produce).
@Nonnull static <T,R> LSupplier<LOiFunction<T,R>> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static <T,R> LOiFunction<T,R> safe(@Nullable LOiFunction<T,R> other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static <T,R> LSupplier<LOiFunction<T,R>> safeSupplier(@Nullable LSupplier<LOiFunction<T,R>> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default <V1> LOiFunction<V1,R> compose(@Nonnull LFunction<? super V1,? extends T> before1, @Nonnull LIntUnaryOperator before2)
Allows to manipulate the domain of the function.
static <V1,T,R> LOiFunction<V1,R> composed(@Nonnull LFunction<? super V1,? extends T> before1, @Nonnull LIntUnaryOperator before2, LOiFunction<T,R> after)
@Nonnull default <V1,V2> LBiFunction<V1,V2,R> oiFuncCompose(@Nonnull LFunction<? super V1,? extends T> before1, @Nonnull LToIntFunction<? super V2> before2)
Allows to manipulate the domain of the function.
static <V1,V2,T,R> LBiFunction<V1,V2,R> composed(@Nonnull LFunction<? super V1,? extends T> before1, @Nonnull LToIntFunction<? super V2> before2, LOiFunction<T,R> after)
@Nonnull default <V> LOiFunction<T,V> then(@Nonnull LFunction<? super R,? extends V> after)
Combines two functions together in a order.
@Nonnull default LObjIntConsumer<T> thenConsume(@Nonnull LConsumer<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiFunction<T,R> before(@Nonnull LObjIntConsumer<? super T> before)
@Nonnull default LOiToByteFunction<T> thenToByte(@Nonnull LToByteFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToSrtFunction<T> thenToSrt(@Nonnull LToSrtFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToIntFunction<T> thenToInt(@Nonnull LToIntFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToLongFunction<T> thenToLong(@Nonnull LToLongFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToFltFunction<T> thenToFlt(@Nonnull LToFltFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToDblFunction<T> thenToDbl(@Nonnull LToDblFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiToCharFunction<T> thenToChar(@Nonnull LToCharFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LObjIntPredicate<T> thenToBool(@Nonnull LPredicate<? super R> after)
Combines two functions together in a order.
@Nonnull default LOiFunction<T,R> nonNullable()
Converts to function that makes sure that the result is not null.
static <T,R> R produce(T a1,
int a2)
Does nothing (LOiFunction) Function
static <T,R> R produce(int a2,
T a1)
Does nothing (LOiFunction.LIntObjFunc) Function
default <C1,C2> void forEach(IndexedRead<C1,aType.a<T>> ia1, C1 source1, IndexedRead<C2,aType.aInt> ia2, C2 source2, LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method is not expected.
default <C1,I1,C2> void iterate(SequentialRead<C1,I1,aType.a<T>> sa1, C1 source1, IndexedRead<C2,aType.aInt> ia2, C2 source2, LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method is not expected.
default <C1,C2,I2> void iterate(IndexedRead<C1,aType.a<T>> ia1, C1 source1, SequentialRead<C2,I2,aType.aInt> sa2, C2 source2, LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method is not expected.
default <C1,I1,C2,I2> void iterate(SequentialRead<C1,I1,aType.a<T>> sa1, C1 source1, SequentialRead<C2,I2,aType.aInt> sa2, C2 source2, LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer. Thread safety, fail-fast, fail-safety of this method depends highly on the arguments.
Copyright © 2019. All rights reserved.