Record Class MapResult<T>
java.lang.Object
java.lang.Record
software.amazon.lambda.durable.model.MapResult<T>
- Type Parameters:
T- the result type of each item- Record Components:
items- ordered result items from the map operationcompletionReason- why the operation completed
public record MapResult<T>(List<MapResult.MapResultItem<T>> items, ConcurrencyCompletionStatus completionReason)
extends Record
Result container for map operations.
Holds ordered results from a map operation. Each index corresponds to the input item at the same position. Each
item is represented as a MapResult.MapResultItem containing its status, result, and error. Includes the
ConcurrencyCompletionStatus indicating why the operation completed.
Errors are stored as MapResult.MapError rather than raw Throwable, so they survive serialization across
checkpoint-and-replay cycles without requiring AWS SDK-specific Jackson modules.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordError details for a failed map item.static final recordRepresents the outcome of a single item in a map operation. -
Constructor Summary
ConstructorsConstructorDescriptionMapResult(List<MapResult.MapResultItem<T>> items, ConcurrencyCompletionStatus completionReason) Compact constructor that applies defensive copy and defaults. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if all items succeeded (no failures or not-started items).Returns the value of thecompletionReasonrecord component.static <T> MapResult<T>empty()Returns an empty MapResult with no items.final booleanIndicates whether some other object is "equal to" this one.failed()Returns errors from items that failed.getError(int index) Returns the error at the given index, or null if that item succeeded or was not started.getItem(int index) Returns the result item at the given index.getResult(int index) Returns the result at the given index, or null if that item failed or was not started.final inthashCode()Returns a hash code value for this object.items()Returns the value of theitemsrecord component.results()Returns all results as an unmodifiable list (nulls for failed/not-started items).intsize()Returns the number of items in this result.Returns results from items that succeeded (includes null results from successful items).final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MapResult
public MapResult(List<MapResult.MapResultItem<T>> items, ConcurrencyCompletionStatus completionReason) Compact constructor that applies defensive copy and defaults.
-
-
Method Details
-
empty
Returns an empty MapResult with no items. -
getItem
Returns the result item at the given index. -
getResult
Returns the result at the given index, or null if that item failed or was not started. -
getError
Returns the error at the given index, or null if that item succeeded or was not started. -
allSucceeded
public boolean allSucceeded()Returns true if all items succeeded (no failures or not-started items). -
size
public int size()Returns the number of items in this result. -
results
Returns all results as an unmodifiable list (nulls for failed/not-started items). -
succeeded
Returns results from items that succeeded (includes null results from successful items). -
failed
Returns errors from items that failed. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-
completionReason
Returns the value of thecompletionReasonrecord component.- Returns:
- the value of the
completionReasonrecord component
-