Class PipeUtil.Pipe<T>
java.lang.Object
cloud.opencode.base.functional.pipeline.PipeUtil.Pipe<T>
- Type Parameters:
T- value type - 值类型
- Enclosing class:
PipeUtil
Pipe - Value holder for pipe operations
Pipe - 管道操作的值持有者
- Since:
- JDK 25, opencode-base-functional V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionget()Get the final value 获取最终值Get the value or default if null 获取值或默认值(如果为 null)Perform side effect without changing value 执行副作用而不改变值<R> PipeUtil.Pipe<R> Apply a transformation 应用转换thenIf(boolean condition, UnaryOperator<T> function) Apply transformation if condition is true 如果条件为真则应用转换<R> PipeUtil.Pipe<R> thenIfPresent(Function<? super T, ? extends R> function) Apply transformation if value is non-null 如果值非空则应用转换
-
Method Details
-
then
Apply a transformation 应用转换- Type Parameters:
R- result type - 结果类型- Parameters:
function- transformation - 转换- Returns:
- pipe with transformed value
-
thenIfPresent
Apply transformation if value is non-null 如果值非空则应用转换- Type Parameters:
R- result type - 结果类型- Parameters:
function- transformation - 转换- Returns:
- pipe with transformed value or null
-
thenIf
Apply transformation if condition is true 如果条件为真则应用转换- Parameters:
condition- condition to check - 要检查的条件function- transformation - 转换- Returns:
- pipe with potentially transformed value
-
tap
Perform side effect without changing value 执行副作用而不改变值- Parameters:
consumer- side effect - 副作用- Returns:
- this pipe
-
get
-
getOrElse
-