Class TransactionTree

java.lang.Object
com.daml.ledger.javaapi.data.TransactionTree

public final class TransactionTree extends Object
Helper wrapper of a grpc message used in GetUpdateTrees, GetTransactionTreeById, GetTransactionTreeByOffset, and SubmitAndWaitForTransactionTree calls. Class will be removed in 3.4.0.
  • Constructor Details

  • 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

      public @NonNull String getUpdateId()
    • getCommandId

      public @NonNull String getCommandId()
    • getWorkflowId

      public @NonNull String getWorkflowId()
    • getEffectiveAt

      public @NonNull Instant getEffectiveAt()
    • getOffset

      public @NonNull Long getOffset()
    • getEventsById

      public @NonNull Map<Integer,TreeEvent> getEventsById()
    • getRootNodeIds

      public @NonNull List<Integer> 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

      public @NonNull String getSynchronizerId()
    • getTraceContext

      public @NonNull TraceContextOuterClass.TraceContext getTraceContext()
    • getRecordTime

      public @NonNull Instant getRecordTime()
    • getChildNodeIds

      public @NonNull List<@NonNull Integer> getChildNodeIds(ExercisedEvent exercised)
      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

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object