Package art.cutils.function
Class LazyUnaryOperator<T>
- java.lang.Object
-
- art.cutils.function.LazyUnaryOperator<T>
-
- Type Parameters:
T
- the result type
- All Implemented Interfaces:
Serializable
,Function<T,T>
,UnaryOperator<T>
public final class LazyUnaryOperator<T> extends Object implements UnaryOperator<T>, Serializable
Like theLazyFunction
theLazyUnaryOperator
can be used when the function Argument and Return Type are same.LazyUnaryOperator
is intended to be memorized and idempotent for every parameter. This can be very useful for operations with high latency whose result are used multitudinous. .The result of every function operation are store and retrieves if the same parameter is passed instead of computing again. Every operation is performed once with unique parameters and the result and served whenever needed.- Since:
- 1.0
- Author:
- , Bobai Kato
- See Also:
Function
,LazyFunction
, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description T
apply(T t)
Applies this function to the given argument.boolean
equals(Object o)
int
hashCode()
static <T> @NotNull UnaryOperator<T>
of(UnaryOperator<T> operator)
Take the operator argument of ofUnaryOperator
type.
-
-
-
Method Detail
-
of
@Contract("_ -> new") @NotNull public static <T> @NotNull UnaryOperator<T> of(UnaryOperator<T> operator)
Take the operator argument of ofUnaryOperator
type.- Type Parameters:
T
- the type parameter- Parameters:
operator
- the function, ofUnaryOperator
type- Returns:
- the function, an instance of
Function
type.
-
-