Package com.daml.ledger.javaapi.data
Class TransactionTree
java.lang.Object
com.daml.ledger.javaapi.data.TransactionTree
Helper wrapper of a grpc message used in GetUpdateTrees, GetTransactionTreeById,
GetTransactionTreeByOffset, and SubmitAndWaitForTransactionTree calls. Class will be removed in
3.4.0.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A generic class that encapsulates a transaction tree along with a list of the wrapped root events of the tree. -
Constructor Summary
ConstructorsConstructorDescriptionTransactionTree
(@NonNull String updateId, @NonNull String commandId, @NonNull String workflowId, @NonNull Instant effectiveAt, @NonNull Long offset, @NonNull Map<@NonNull Integer, @NonNull TreeEvent> eventsById, @NonNull String synchronizerId, @NonNull TraceContextOuterClass.TraceContext traceContext, @NonNull Instant recordTime) -
Method Summary
Modifier and TypeMethodDescriptionboolean
static TransactionTree
getChildNodeIds
(ExercisedEvent exercised) Computes the children nodes of an exercised event.@NonNull String
@NonNull Instant
@NonNull Long
@NonNull Instant
Computes the node ids of the root nodes (i.e.@NonNull String
@NonNull TraceContextOuterClass.TraceContext
@NonNull String
@NonNull String
int
hashCode()
toProto()
toString()
<WrappedEvent>
TransactionTree.WrappedTransactionTree<WrappedEvent>toWrappedTree
(BiFunction<TreeEvent, List<WrappedEvent>, WrappedEvent> createWrappedEvent) Constructs a tree described by the transaction tree.
-
Constructor Details
-
TransactionTree
public TransactionTree(@NonNull String updateId, @NonNull String commandId, @NonNull String workflowId, @NonNull Instant effectiveAt, @NonNull Long offset, @NonNull Map<@NonNull Integer, @NonNull TreeEvent> eventsById, @NonNull String synchronizerId, @NonNull TraceContextOuterClass.TraceContext traceContext, @NonNull Instant recordTime)
-
-
Method Details
-
fromProto
-
toProto
-
toWrappedTree
public <WrappedEvent> TransactionTree.WrappedTransactionTree<WrappedEvent> toWrappedTree(BiFunction<TreeEvent, List<WrappedEvent>, WrappedEvent> createWrappedEvent) Constructs a tree described by the transaction tree.- Type Parameters:
WrappedEvent
- the type of the wrapped events of the constructed tree- Parameters:
createWrappedEvent
- the function that constructs a WrappedEvent node of the tree given the current node and its converted children as a list of WrappedEvents nodes- Returns:
- the original transaction tree and the list of the wrapped root events
-
getUpdateId
-
getCommandId
-
getWorkflowId
-
getEffectiveAt
-
getOffset
-
getEventsById
-
getRootNodeIds
Computes the node ids of the root nodes (i.e. the nodes that do not have any ancestors). A node can be considered a root if there are not any ancestors of it. There is no guarantee that the root node was also a root in the original transaction tree (i.e. before filtering out events from the original transaction tree).- Returns:
- the root node ids
-
getSynchronizerId
-
getTraceContext
-
getRecordTime
-
getChildNodeIds
Computes the children nodes of an exercised event. It finds the candidate nodes that could be children of the event given (i.e. its descendants). Then it repeatedly finds from the candidates the one with the lowest id and adds it to its children and removes the child's descendants from the list with the candidates. A node can be considered a child of another node if there are not any intermediate descendants between its parent and itself. There is no guarantee that the child was a child of its parent in the original transaction tree (i.e. before filtering out events from the original transaction tree).- Parameters:
exercised
- the exercised event- Returns:
- the children's node ids
-
toString
-
equals
-
hashCode
public int hashCode()
-