Record Class WaitForConditionResult<T>
java.lang.Object
java.lang.Record
software.amazon.lambda.durable.model.WaitForConditionResult<T>
- Type Parameters:
T- the type of the state value- Record Components:
value- the current state after evaluationisDone- true if the condition is met and polling should stop, false to continue polling
Result returned by a WaitForCondition check function to signal whether the condition is met.
When isDone is true, polling stops and value becomes the final result. When isDone is
false, polling continues using the delay computed by the wait strategy.
-
Constructor Summary
ConstructorsConstructorDescriptionWaitForConditionResult(T value, boolean isDone) Creates an instance of aWaitForConditionResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> WaitForConditionResult<T>continuePolling(T value) Creates a result indicating polling should continue with the given state.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisDone()Returns the value of theisDonerecord component.static <T> WaitForConditionResult<T>stopPolling(T value) Creates a result indicating the condition is met and polling should stop.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
-
Constructor Details
-
Method Details
-
stopPolling
Creates a result indicating the condition is met and polling should stop.- Type Parameters:
T- the type of the state value- Parameters:
value- the final state value- Returns:
- a WaitForConditionResult with isDone=true
-
continuePolling
Creates a result indicating polling should continue with the given state.- Type Parameters:
T- the type of the state value- Parameters:
value- the current state value to pass to the next check- Returns:
- a WaitForConditionResult with isDone=false
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
isDone
public boolean isDone()Returns the value of theisDonerecord component.- Returns:
- the value of the
isDonerecord component
-