@FunctionalInterface public interface LToSrtFunction<T> extends MetaFunction, MetaInterface.NonThrowing, OFunction<T,aType.aShort>, Codomain<aType.aShort>, Domain1<aType.a<T>>
Non-throwing functional interface (lambda) LToSrtFunction for Java 8.
Type: function
Domain (lvl: 1): T a
Co-domain: short
Special case of function that corresponds to expressions like (iterator) -> Iterator::next
| Modifier and Type | Interface and Description |
|---|---|
static class |
LToSrtFunction.LToSrtFunctionSingle<T> |
MetaInterface.NonThrowing, MetaInterface.Throwing<X>| Modifier and Type | Field and Description |
|---|---|
static String |
DESCRIPTION |
| Modifier and Type | Method and Description |
|---|---|
default short |
applyAsSrt(T a) |
default short |
applyAsSrt(T a,
ExWF<RuntimeException> exF) |
default short |
applyAsSrt(T a,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default short |
applyAsSrtThen(T a,
LToSrtFunction<Throwable> handler) |
short |
applyAsSrtX(T a)
Implement this, but call applyAsSrt(T a)
|
static <T> short |
call(T a,
LToSrtFunction<T> lambda) |
default LSrtSupplier |
capture(T a)
Captures arguments but delays the evaluation.
|
default <V2> LToSrtFunction<V2> |
cast()
Cast that replace generics.
|
static <V2,T> LToSrtFunction<V2> |
cast(LToSrtFunction<T> function)
Cast that replace generics.
|
default <V> LToSrtFunction<V> |
compose(LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
|
static <V,T> LToSrtFunction<V> |
composed(LFunction<? super V,? extends T> before,
LToSrtFunction<T> after) |
static <T> LToSrtFunction<T> |
constant(short r)
Creates function that always returns the same value.
|
static <T> LToSrtFunction<T> |
failSafe(LToSrtFunction<T> func,
LToSrtFunction<T> failSafe) |
default short |
failSafeApplyAsSrt(T a,
LToSrtFunction<T> failSafe) |
static <T> short |
failSafeApplyAsSrt(T a,
LToSrtFunction<T> func,
LToSrtFunction<T> failSafe) |
default <C0> void |
forEach(IndexedRead<C0,aType.a<T>> ia,
C0 source,
LSrtConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
static <T> void |
fromTill(int min_i,
int max_i,
T a,
LToSrtFunction<T> func)
From-To.
|
static <T> void |
fromTo(int min_i,
int max_i,
T a,
LToSrtFunction<T> func)
From-To.
|
default String |
functionalInterfaceDescription()
Returns description of the functional interface.
|
default LToSrtFunction<T> |
handling(HandlingInstructions<Throwable,RuntimeException> handling) |
default short |
handlingApplyAsSrt(T a,
HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
|
static <T> short |
handlingApplyAsSrt(T a,
LToSrtFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling) |
default <C0,I0> void |
iterate(SequentialRead<C0,I0,aType.a<T>> sa,
C0 source,
LSrtConsumer consumer)
For each element (or tuple) from arguments, calls the function and passes the result to consumer.
|
default short |
nestingApplyAsSrt(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
|
default short |
nonNullApplyAsSrt(T a)
Just to mirror the method: Ensures the result is not null
|
static <T> short |
produceShort(T a)
Does nothing (LToSrtFunction) Function
|
static <T> LToSrtFunction<T> |
recursive(LFunction<LToSrtFunction<T>,LToSrtFunction<T>> selfLambda) |
static <T> LToSrtFunction<T> |
safe()
Safe instance.
|
static <T> LToSrtFunction<T> |
safe(LToSrtFunction<T> other)
Safe wrapping.
|
static <T> LSupplier<LToSrtFunction<T>> |
safeSupplier()
Safe instance supplier.
|
static <T> LSupplier<LToSrtFunction<T>> |
safeSupplier(LSupplier<LToSrtFunction<T>> supplier)
Safe supplier.
|
default short |
shovingApplyAsSrt(T a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
|
default <V> LFunction<T,V> |
then(LSrtFunction<? extends V> after)
Combines two functions together in a order.
|
default LPredicate<T> |
thenToBool(LSrtPredicate after)
Combines two functions together in a order.
|
default LToByteFunction<T> |
thenToByte(LSrtToByteFunction after)
Combines two functions together in a order.
|
default LToCharFunction<T> |
thenToChar(LSrtToCharFunction after)
Combines two functions together in a order.
|
default LToDblFunction<T> |
thenToDbl(LSrtToDblFunction after)
Combines two functions together in a order.
|
default LToFltFunction<T> |
thenToFlt(LSrtToFltFunction after)
Combines two functions together in a order.
|
default LToIntFunction<T> |
thenToInt(LSrtToIntFunction after)
Combines two functions together in a order.
|
default LToLongFunction<T> |
thenToLong(LSrtToLongFunction after)
Combines two functions together in a order.
|
default LToSrtFunction<T> |
thenToSrt(LSrtUnaryOperator after)
Combines two functions together in a order.
|
static <T> void |
times(int max_i,
T a,
LToSrtFunction<T> func)
From-To.
|
static <T> LToSrtFunction<T> |
toSrtFunc(LToSrtFunction<T> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
|
static <T> LToSrtFunction<T> |
toSrtFuncThrowing(ExF<Throwable> exF) |
static <T> LToSrtFunction<T> |
toSrtFuncThrowing(String message,
ExMF<Throwable> exF) |
static <T> short |
tryApplyAsSrt(T a,
LToSrtFunction<T> func) |
static <T> short |
tryApplyAsSrt(T a,
LToSrtFunction<T> func,
ExWF<RuntimeException> exF) |
static <T> short |
tryApplyAsSrt(T a,
LToSrtFunction<T> func,
ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
static <T> short |
tryApplyAsSrtThen(T a,
LToSrtFunction<T> func,
LToSrtFunction<Throwable> handler) |
default LToSrtFunction<T> |
trying(ExWF<RuntimeException> exF) |
default LToSrtFunction<T> |
trying(ExWMF<RuntimeException> exF,
String newMessage,
Object... messageParams) |
default LToSrtFunction<T> |
tryingThen(LToSrtFunction<Throwable> handler) |
default short |
tupleApplyAsSrt(LSingle<T> args) |
default LToSrtFunction |
untyped()
Cast that removes generics.
|
isThrowingisFunctionformatTo, isAction, isConsumer, isOperator, isPredicate, isSupplierstatic final String DESCRIPTION
default short applyAsSrt(T a)
short applyAsSrtX(T a) throws Throwable
Implement this, but call applyAsSrt(T a)
Throwabledefault short handlingApplyAsSrt(T a, HandlingInstructions<Throwable,RuntimeException> handling)
Function call that handles exceptions according to the instructions.
default LToSrtFunction<T> handling(HandlingInstructions<Throwable,RuntimeException> handling)
default short applyAsSrt(T a, @Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default LToSrtFunction<T> trying(@Nonnull ExWMF<RuntimeException> exF, @Nonnull String newMessage, @Nullable Object... messageParams)
default short applyAsSrt(T a, @Nonnull ExWF<RuntimeException> exF)
default LToSrtFunction<T> trying(@Nonnull ExWF<RuntimeException> exF)
default short applyAsSrtThen(T a, @Nonnull LToSrtFunction<Throwable> handler)
default LToSrtFunction<T> tryingThen(@Nonnull LToSrtFunction<Throwable> handler)
default short nestingApplyAsSrt(T a)
Function call that handles exceptions by always nesting checked exceptions and propagating the others as is.
default short shovingApplyAsSrt(T a)
Function call that handles exceptions by always propagating them as is, even when they are undeclared checked ones.
static <T> short handlingApplyAsSrt(T a,
LToSrtFunction<T> func,
HandlingInstructions<Throwable,RuntimeException> handling)
static <T> short tryApplyAsSrt(T a,
LToSrtFunction<T> func)
static <T> short tryApplyAsSrt(T a,
LToSrtFunction<T> func,
@Nonnull
ExWMF<RuntimeException> exF,
@Nonnull
String newMessage,
@Nullable
Object... messageParams)
static <T> short tryApplyAsSrt(T a,
LToSrtFunction<T> func,
@Nonnull
ExWF<RuntimeException> exF)
static <T> short tryApplyAsSrtThen(T a,
LToSrtFunction<T> func,
@Nonnull
LToSrtFunction<Throwable> handler)
default short failSafeApplyAsSrt(T a, @Nonnull LToSrtFunction<T> failSafe)
static <T> short failSafeApplyAsSrt(T a,
LToSrtFunction<T> func,
@Nonnull
LToSrtFunction<T> failSafe)
static <T> LToSrtFunction<T> failSafe(LToSrtFunction<T> func, @Nonnull LToSrtFunction<T> failSafe)
default short nonNullApplyAsSrt(T a)
Just to mirror the method: Ensures the result is not null
@Nonnull default String functionalInterfaceDescription()
Returns description of the functional interface.
functionalInterfaceDescription in interface MetaFunctionalInterfacestatic <T> void fromTo(int min_i,
int max_i,
T a,
LToSrtFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void fromTill(int min_i,
int max_i,
T a,
LToSrtFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
static <T> void times(int max_i,
T a,
LToSrtFunction<T> func)
From-To. Intended to be used with non-capturing lambda.
default LToSrtFunction untyped()
Cast that removes generics.
default <V2> LToSrtFunction<V2> cast()
Cast that replace generics.
static <V2,T> LToSrtFunction<V2> cast(LToSrtFunction<T> function)
Cast that replace generics.
default LSrtSupplier capture(T a)
Captures arguments but delays the evaluation.
static <T> LToSrtFunction<T> constant(short r)
Creates function that always returns the same value.
@Nonnull static <T> LToSrtFunction<T> toSrtFunc(@Nonnull LToSrtFunction<T> lambda)
Convenient method in case lambda expression is ambiguous for the compiler (that might happen for overloaded methods accepting different interfaces).
@Nonnull static <T> LToSrtFunction<T> recursive(@Nonnull LFunction<LToSrtFunction<T>,LToSrtFunction<T>> selfLambda)
@Nonnull static <T> LToSrtFunction<T> toSrtFuncThrowing(@Nonnull ExF<Throwable> exF)
@Nonnull static <T> LToSrtFunction<T> toSrtFuncThrowing(String message, @Nonnull ExMF<Throwable> exF)
static <T> short call(T a,
@Nonnull
LToSrtFunction<T> lambda)
@Nonnull static <T> LToSrtFunction<T> safe()
Safe instance. That always returns the same value (as produceShort).
@Nonnull static <T> LSupplier<LToSrtFunction<T>> safeSupplier()
Safe instance supplier. Returns supplier of safe() instance.
@Nonnull static <T> LToSrtFunction<T> safe(@Nullable LToSrtFunction<T> other)
Safe wrapping. Either argument function is returned (if it is not null) or safe() instance.
@Nonnull static <T> LSupplier<LToSrtFunction<T>> safeSupplier(@Nullable LSupplier<LToSrtFunction<T>> supplier)
Safe supplier. Either argument supplier is returned (if it is not null) or supplier of safe() instance.
@Nonnull default <V> LToSrtFunction<V> compose(@Nonnull LFunction<? super V,? extends T> before)
Allows to manipulate the domain of the function.
static <V,T> LToSrtFunction<V> composed(@Nonnull LFunction<? super V,? extends T> before, LToSrtFunction<T> after)
@Nonnull default <V> LFunction<T,V> then(@Nonnull LSrtFunction<? extends V> after)
Combines two functions together in a order.
@Nonnull default LToByteFunction<T> thenToByte(@Nonnull LSrtToByteFunction after)
Combines two functions together in a order.
@Nonnull default LToSrtFunction<T> thenToSrt(@Nonnull LSrtUnaryOperator after)
Combines two functions together in a order.
@Nonnull default LToIntFunction<T> thenToInt(@Nonnull LSrtToIntFunction after)
Combines two functions together in a order.
@Nonnull default LToLongFunction<T> thenToLong(@Nonnull LSrtToLongFunction after)
Combines two functions together in a order.
@Nonnull default LToFltFunction<T> thenToFlt(@Nonnull LSrtToFltFunction after)
Combines two functions together in a order.
@Nonnull default LToDblFunction<T> thenToDbl(@Nonnull LSrtToDblFunction after)
Combines two functions together in a order.
@Nonnull default LToCharFunction<T> thenToChar(@Nonnull LSrtToCharFunction after)
Combines two functions together in a order.
@Nonnull default LPredicate<T> thenToBool(@Nonnull LSrtPredicate after)
Combines two functions together in a order.
static <T> short produceShort(T a)
Does nothing (LToSrtFunction) Function
default <C0> void forEach(IndexedRead<C0,aType.a<T>> ia, C0 source, LSrtConsumer 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.a<T>> sa, C0 source, LSrtConsumer 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.