@FunctionalInterface public interface LSrtFunction<R> extends MetaFunction, MetaInterface.NonThrowing, Codomain<aType.a<R>>, Domain1<aType.aShort>
Non-throwing functional interface (lambda) LSrtFunction for Java 8.
Type: function
Domain (lvl: 1): short a
Co-domain: R
| Modifier and Type | Interface and Description |
|---|---|
static class |
LSrtFunction.LSrtFunctionSingle<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 LSrtFunction<R> |
after(LConsumer<? super R> after) |
default R |
apply(short a) |
default R |
apply(short a,
ExWF<RuntimeException> exF) |
default R |
apply(short a,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default R |
applyThen(short a,
LFunction<Throwable,R> handler) |
R |
applyX(short a)
Implement this, but call apply(short a)
|
default LSrtFunction<R> |
before(LSrtConsumer before) |
static <R> R |
call(short a,
LSrtFunction<R> lambda) |
default LSupplier<R> |
capture(short a)
Captures arguments but delays the evaluation.
|
default <V2> LSrtFunction<V2> |
cast()
Cast that replace generics.
|
static <V2,R> LSrtFunction<V2> |
cast(LSrtFunction<R> function)
Cast that replace generics.
|
default LSrtFunction<R> |
compose(LSrtUnaryOperator before)
Allows to manipulate the domain of the function.
|
static <R> LSrtFunction<R> |
composed(LSrtUnaryOperator before,
LSrtFunction<R> after) |
static <V,R> LFunction<V,R> |
composed(LToSrtFunction<? super V> before,
LSrtFunction<R> after) |
static <R> LSrtFunction<R> |
constant(R r)
Creates function that always returns the same value.
|
static <R> LSrtFunction<R> |
failSafe(LSrtFunction<R> func,
LSrtFunction<R> failSafe) |
default R |
failSafeApply(short a,
LSrtFunction<R> failSafe) |
static <R> R |
failSafeApply(short a,
LSrtFunction<R> func,
LSrtFunction<R> failSafe) |
default <C0> void |
forEach(IndexedRead<C0,aType.aShort> ia,
C0 source,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static <R> void |
fromTill(int min_i,
int max_i,
short a,
LSrtFunction<R> func)
From-To.
|
static <R> void |
fromTo(int min_i,
int max_i,
short a,
LSrtFunction<R> func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LSrtFunction<R> |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default R |
handlingApply(short a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static <R> R |
handlingApply(short a,
LSrtFunction<R> func,
HandlingInstructions<Throwable,RuntimeException> handling) |
default <C0,I0> void |
iterate(SequentialRead<C0,I0,aType.aShort> sa,
C0 source,
LConsumer<? super R> consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default R |
nestingApply(short a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default LSrtFunction<R> |
nonNullable()
Converts to function that makes sure that the result is not null.
|
default R |
nonNullApply(short a)
Function call that ensures the result is not null
|
static <R> R |
produce(short a)
Does nothing (LSrtFunction) Function
|
static <R> LSrtFunction<R> |
recursive(LFunction<LSrtFunction<R>,LSrtFunction<R>> selfLambda) |
static <R> LSrtFunction<R> |
safe()
Safe instance.
|
static <R> LSrtFunction<R> |
safe(LSrtFunction<R> other)
Safe wrapping.
|
static <R> LSupplier<LSrtFunction<R>> |
safeSupplier()
Safe instance supplier.
|
static <R> LSupplier<LSrtFunction<R>> |
safeSupplier(LSupplier<LSrtFunction<R>> supplier)
Safe supplier.
|
default R |
shovingApply(short a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
|
static <R> LSrtFunction<R> |
srtFunc(LSrtFunction<R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
default <V> LFunction<V,R> |
srtFuncCompose(LToSrtFunction<? super V> before)
Allows to manipulate the domain of the function.
|
static <R> LSrtFunction<R> |
srtFuncThrowing(ExF<Throwable> exF) |
static <R> LSrtFunction<R> |
srtFuncThrowing(String message,
ExMF<Throwable> exF) |
default <V> LSrtFunction<V> |
then(LFunction<? super R,? extends V> after)
Combines two functions together in a order.
|
default LSrtConsumer |
thenConsume(LConsumer<? super R> after)
Combines two functions together in a order.
|
default LSrtPredicate |
thenToBool(LPredicate<? super R> after)
Combines two functions together in a order.
|
default LSrtToByteFunction |
thenToByte(LToByteFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtToCharFunction |
thenToChar(LToCharFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtToDblFunction |
thenToDbl(LToDblFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtToFltFunction |
thenToFlt(LToFltFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtToIntFunction |
thenToInt(LToIntFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtToLongFunction |
thenToLong(LToLongFunction<? super R> after)
Combines two functions together in a order.
|
default LSrtUnaryOperator |
thenToSrt(LToSrtFunction<? super R> after)
Combines two functions together in a order.
|
static <R> void |
times(int max_i,
short a,
LSrtFunction<R> func)
From-To.
|
static <R> R |
tryApply(short a,
LSrtFunction<R> func) |
static <R> R |
tryApply(short a,
LSrtFunction<R> func,
ExWF<RuntimeException> exF) |
static <R> R |
tryApply(short a,
LSrtFunction<R> func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <R> R |
tryApplyThen(short a,
LSrtFunction<R> func,
LFunction<Throwable,R> handler) |
default LSrtFunction<R> |
trying(ExWF<RuntimeException> exF) |
default LSrtFunction<R> |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LSrtFunction<R> |
tryingThen(LFunction<Throwable,R> handler) |
default R |
tupleApply(LSrtSingle args) |
default LSrtFunction |
untyped()
Cast that removes generics.
|
isFunctionformatTo, isAction, isConsumer, isOperator, isPredicate, isSupplierisThrowingstatic final String DESCRIPTION
default R tupleApply(LSrtSingle args)
default R handlingApply(short a, HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LSrtFunction<R> handling(HandlingInstructions<Throwable,RuntimeException> handling)
default R apply(short a, @Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default LSrtFunction<R> trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default R apply(short a, @Nonnull ExWF<RuntimeException> exF)
default LSrtFunction<R> trying(@Nonnull ExWF<RuntimeException> exF)
default R nestingApply(short a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default R shovingApply(short a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static <R> R handlingApply(short a,
LSrtFunction<R> func,
HandlingInstructions<Throwable,RuntimeException> handling)
static <R> R tryApply(short a,
LSrtFunction<R> func)
static <R> R tryApply(short a,
LSrtFunction<R> func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static <R> R tryApply(short a,
LSrtFunction<R> func,
@Nonnull
ExWF<RuntimeException> exF)
static <R> R tryApplyThen(short a,
LSrtFunction<R> func,
@Nonnull
LFunction<Throwable,R> handler)
default R failSafeApply(short a, @Nonnull LSrtFunction<R> failSafe)
static <R> R failSafeApply(short a,
LSrtFunction<R> func,
@Nonnull
LSrtFunction<R> failSafe)
static <R> LSrtFunction<R> failSafe(LSrtFunction<R> func, @Nonnull LSrtFunction<R> failSafe)
@Nonnull default R nonNullApply(short a)
Function call that ensures the result is not null
@Nonnull default String functionalInterfaceDescription()
Returns description of the functional interface.
functionalInterfaceDescription in interface MetaFunctionalInterfacestatic <R> void fromTo(int min_i,
int max_i,
short a,
LSrtFunction<R> func)
From-To. Intended to be used with non-capturing lambda.
static <R> void fromTill(int min_i,
int max_i,
short a,
LSrtFunction<R> func)
From-To. Intended to be used with non-capturing lambda.
static <R> void times(int max_i,
short a,
LSrtFunction<R> func)
From-To. Intended to be used with non-capturing lambda.
default LSrtFunction untyped()
Cast that removes generics.
default <V2> LSrtFunction<V2> cast()
Cast that replace generics.
static <V2,R> LSrtFunction<V2> cast(LSrtFunction<R> function)
Cast that replace generics.
static <R> LSrtFunction<R> constant(R r)
Creates function that always returns the same value.
@Nonnull static <R> LSrtFunction<R> srtFunc(@Nonnull LSrtFunction<R> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
@Nonnull static <R> LSrtFunction<R> recursive(@Nonnull LFunction<LSrtFunction<R>,LSrtFunction<R>> selfLambda)
@Nonnull static <R> LSrtFunction<R> srtFuncThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static <R> LSrtFunction<R> srtFuncThrowing(String message, @Nonnull ExMF<Throwable> exF)
static <R> R call(short a,
@Nonnull
LSrtFunction<R> lambda)
@Nonnull static <R> LSrtFunction<R> safe()
Safe instance. That always returns the same value (as produce).
@Nonnull static <R> LSupplier<LSrtFunction<R>> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static <R> LSrtFunction<R> safe(@Nullable LSrtFunction<R> other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static <R> LSupplier<LSrtFunction<R>> safeSupplier(@Nullable LSupplier<LSrtFunction<R>> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default LSrtFunction<R> compose(@Nonnull LSrtUnaryOperator before)
Allows to manipulate the domain of the function.
static <R> LSrtFunction<R> composed(@Nonnull LSrtUnaryOperator before, LSrtFunction<R> after)
@Nonnull default <V> LFunction<V,R> srtFuncCompose(@Nonnull LToSrtFunction<? super V> before)
Allows to manipulate the domain of the function.
static <V,R> LFunction<V,R> composed(@Nonnull LToSrtFunction<? super V> before, LSrtFunction<R> after)
@Nonnull default <V> LSrtFunction<V> then(@Nonnull LFunction<? super R,? extends V> after)
Combines two functions together in a order.
@Nonnull default LSrtConsumer thenConsume(@Nonnull LConsumer<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtFunction<R> before(@Nonnull LSrtConsumer before)
@Nonnull default LSrtToByteFunction thenToByte(@Nonnull LToByteFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtUnaryOperator thenToSrt(@Nonnull LToSrtFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtToIntFunction thenToInt(@Nonnull LToIntFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtToLongFunction thenToLong(@Nonnull LToLongFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtToFltFunction thenToFlt(@Nonnull LToFltFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtToDblFunction thenToDbl(@Nonnull LToDblFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtToCharFunction thenToChar(@Nonnull LToCharFunction<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtPredicate thenToBool(@Nonnull LPredicate<? super R> after)
Combines two functions together in a order.
@Nonnull default LSrtFunction<R> nonNullable()
Converts to function that makes sure that the result is not null.
static <R> R produce(short a)
Does nothing (LSrtFunction) Function
default <C0> void forEach(IndexedRead<C0,aType.aShort> ia, C0 source, 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 <C0,I0> void iterate(SequentialRead<C0,I0,aType.aShort> sa, C0 source, 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.