Interface Node


@Experimental @Immutable public interface Node
Represents a dependency node within a Maven project's dependency collector.
Since:
4.0.0
See Also:
  • Method Details

    • getDependency

      Dependency getDependency()
      Returns:
      dependency for this node
    • getChildren

      @Nonnull List<Node> getChildren()
      Gets the child nodes of this node.
      Returns:
      the child nodes of this node, never null
    • getRemoteRepositories

      @Nonnull List<RemoteRepository> getRemoteRepositories()
      Returns:
      repositories of this node
    • getRepository

      The repository where this artifact has been downloaded from.
    • accept

      boolean accept(@Nonnull NodeVisitor visitor)
      Traverses this node and potentially its children using the specified visitor.
      Parameters:
      visitor - the visitor to call back, must not be null
      Returns:
      true to visit siblings nodes of this node as well, false to skip siblings
    • filter

      Node filter(Predicate<Node> filter)
      Returns a new tree starting at this node, filtering the children. Note that this node will not be filtered and only the children and its descendant will be checked.
      Parameters:
      filter - the filter to apply
      Returns:
      a new filtered graph
    • asString

      String asString()
      Returns a string representation of this dependency node.
      Returns:
      the string representation
    • stream

      @Nonnull default Stream<Node> stream()
      Obtain a Stream containing this node and all its descendant.
      Returns:
      a stream containing this node and its descendant