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