Record Class Trampoline.More<T>
java.lang.Object
java.lang.Record
cloud.opencode.base.functional.monad.Trampoline.More<T>
- Type Parameters:
T- result type - 结果类型- Record Components:
continuation- supplier of the next computation - 下一个计算的供应商
- All Implemented Interfaces:
Trampoline<T>
- Enclosing interface:
Trampoline<T>
public static record Trampoline.More<T>(Supplier<Trampoline<T>> continuation)
extends Record
implements Trampoline<T>
Suspended Trampoline with a continuation.
包含延续的挂起 Trampoline。
- Since:
- JDK 25, opencode-base-functional V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface Trampoline
Trampoline.Done<T>, Trampoline.FlatMap<A,B>, Trampoline.More<T> -
Constructor Summary
ConstructorsConstructorDescriptionMore(Supplier<Trampoline<T>> continuation) Creates an instance of aMorerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontinuationrecord component.final booleanIndicates whether some other object is "equal to" this one.<U> Trampoline<U> flatMap(Function<? super T, Trampoline<U>> f) Chain another Trampoline computation.final inthashCode()Returns a hash code value for this object.booleanisDone()Check if the Trampoline is complete.toString()Returns a string representation of this record class.
-
Constructor Details
-
More
Creates an instance of aMorerecord class.- Parameters:
continuation- the value for thecontinuationrecord component
-
-
Method Details
-
isDone
public boolean isDone()Description copied from interface:TrampolineCheck if the Trampoline is complete. 检查 Trampoline 是否完成。- Specified by:
isDonein interfaceTrampoline<T>- Returns:
- true if done - 如果完成返回 true
-
flatMap
Description copied from interface:TrampolineChain another Trampoline computation. 链接另一个 Trampoline 计算。Enables composition of multiple trampolined computations.
启用多个蹦床计算的组合。
- Specified by:
flatMapin interfaceTrampoline<T>- Type Parameters:
U- result type - 结果类型- Parameters:
f- function producing the next Trampoline - 产生下一个 Trampoline 的函数- Returns:
- chained Trampoline
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
continuation
Returns the value of thecontinuationrecord component.- Returns:
- the value of the
continuationrecord component
-