org.eclipse.aether.util.graph.traverser

## Class AndDependencyTraverser

- java.lang.Object
- - org.eclipse.aether.util.graph.traverser.AndDependencyTraverser

- All Implemented Interfaces:
    DependencyTraverser

      public final class AndDependencyTraverser
      extends Object
      implements DependencyTraverser

  A dependency traverser that combines zero or more other traversers using a logical `AND`. The resulting traverser enables processing of child dependencies if and only if all constituent traversers request traversal.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AndDependencyTraverser(Collection<? extends DependencyTraverser> traversers)` Creates a new traverser from the specified traversers.
    `AndDependencyTraverser(DependencyTraverser... traversers)` Creates a new traverser from the specified traversers.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DependencyTraverser` | `deriveChildTraverser(DependencyCollectionContext context)` Derives a dependency traverser that will be used to decide whether the transitive dependencies of the dependency given in the collection context shall be traversed.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `static DependencyTraverser` | `newInstance(DependencyTraverser traverser1, DependencyTraverser traverser2)` Creates a new traverser from the specified traversers.
    `boolean` | `traverseDependency(Dependency dependency)` Decides whether the dependencies of the specified dependency should be traversed.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AndDependencyTraverser

          public AndDependencyTraverser(DependencyTraverser... traversers)

      Creates a new traverser from the specified traversers. Prefer `newInstance(DependencyTraverser, DependencyTraverser)` if any of the input traversers might be `null`.
      Parameters:
        `traversers` - The traversers to combine, may be `null` but must not contain `null` elements.

    - #### AndDependencyTraverser

          public AndDependencyTraverser(Collection<? extends DependencyTraverser> traversers)

      Creates a new traverser from the specified traversers.
      Parameters:
        `traversers` - The traversers to combine, may be `null` but must not contain `null` elements.

  - ### Method Detail

    - #### newInstance

          public static DependencyTraverser newInstance(DependencyTraverser traverser1,
                                        DependencyTraverser traverser2)

      Creates a new traverser from the specified traversers.
      Parameters:
        `traverser1` - The first traverser to combine, may be `null`.
        `traverser2` - The second traverser to combine, may be `null`.
      Returns:
        The combined traverser or `null` if both traversers were `null`.

    - #### traverseDependency

          public boolean traverseDependency(Dependency dependency)

      Description copied from interface: `DependencyTraverser`
      Decides whether the dependencies of the specified dependency should be traversed.
      Specified by:
        `traverseDependency` in interface `DependencyTraverser`
      Parameters:
        `dependency` - The dependency to check, must not be `null`.
      Returns:
        `true` if the dependency graph builder should recurse into the specified dependency and process its dependencies, `false` otherwise.

    - #### deriveChildTraverser

          public DependencyTraverser deriveChildTraverser(DependencyCollectionContext context)

      Description copied from interface: `DependencyTraverser`
      Derives a dependency traverser that will be used to decide whether the transitive dependencies of the dependency given in the collection context shall be traversed. When calculating the child traverser, implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
      Specified by:
        `deriveChildTraverser` in interface `DependencyTraverser`
      Parameters:
        `context` - The dependency collection context, must not be `null`.
      Returns:
        The dependency traverser for the target node or `null` if dependencies should be unconditionally traversed in the sub graph.

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.