Package pro.horde.os.cutils.function
Class LazyUnaryOperator<T>
- java.lang.Object
-
- pro.horde.os.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 theLazyFunctiontheLazyUnaryOperatorcan be used when the function Argument and Return Type are same.LazyUnaryOperatoris 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:
- 5.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 Tapply(T t)Applies this function to the given argument.booleanequals(Object o)inthashCode()static <T> UnaryOperator<T>of(UnaryOperator<T> operator)Take the operator argument of ofUnaryOperatortype.
-
-
-
Method Detail
-
of
public static <T> UnaryOperator<T> of(UnaryOperator<T> operator)
Take the operator argument of ofUnaryOperatortype.- Type Parameters:
T- the type parameter- Parameters:
operator- the function, ofUnaryOperatortype- Returns:
- the function, an instance of
Functiontype.
-
-