org.eclipse.aether.resolution

## Class DependencyRequest

- java.lang.Object
- - org.eclipse.aether.resolution.DependencyRequest

-     public final class DependencyRequest
      extends Object

  A request to resolve transitive dependencies. This request can either be supplied with a `CollectRequest` to calculate the transitive dependencies or with an already resolved dependency graph.
  See Also:
    `RepositorySystem.resolveDependencies(RepositorySystemSession, DependencyRequest)`, `Artifact.getFile()`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DependencyRequest()` Creates an uninitialized request.
    `DependencyRequest(CollectRequest request, DependencyFilter filter)` Creates a request for the specified collect request and with the given resolution filter.
    `DependencyRequest(DependencyNode node, DependencyFilter filter)` Creates a request for the specified dependency graph and with the given resolution filter.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `CollectRequest` | `getCollectRequest()` Gets the collect request used to calculate the dependency graph whose artifacts should be resolved.
    `DependencyFilter` | `getFilter()` Gets the resolution filter used to select which artifacts of the dependency graph should be resolved.
    `DependencyNode` | `getRoot()` Gets the root node of the dependency graph whose artifacts should be resolved.
    `RequestTrace` | `getTrace()` Gets the trace information that describes the higher level request/operation in which this request is issued.
    `DependencyRequest` | `setCollectRequest(CollectRequest collectRequest)` Sets the collect request used to calculate the dependency graph whose artifacts should be resolved.
    `DependencyRequest` | `setFilter(DependencyFilter filter)` Sets the resolution filter used to select which artifacts of the dependency graph should be resolved.
    `DependencyRequest` | `setRoot(DependencyNode root)` Sets the root node of the dependency graph whose artifacts should be resolved.
    `DependencyRequest` | `setTrace(RequestTrace trace)` Sets the trace information that describes the higher level request/operation in which this request is issued.
    `String` | `toString()`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DependencyRequest

          public DependencyRequest()

      Creates an uninitialized request. Note that either `setRoot(DependencyNode)` or `setCollectRequest(CollectRequest)` must eventually be called to create a valid request.

    - #### DependencyRequest

          public DependencyRequest(DependencyNode node,
                           DependencyFilter filter)

      Creates a request for the specified dependency graph and with the given resolution filter.
      Parameters:
        `node` - The root node of the dependency graph whose artifacts should be resolved, may be `null`.
        `filter` - The resolution filter to use, may be `null`.

    - #### DependencyRequest

          public DependencyRequest(CollectRequest request,
                           DependencyFilter filter)

      Creates a request for the specified collect request and with the given resolution filter.
      Parameters:
        `request` - The collect request used to calculate the dependency graph whose artifacts should be resolved, may be `null`.
        `filter` - The resolution filter to use, may be `null`.

  - ### Method Detail

    - #### getRoot

          public DependencyNode getRoot()

      Gets the root node of the dependency graph whose artifacts should be resolved.
      Returns:
        The root node of the dependency graph or `null` if none.

    - #### setRoot

          public DependencyRequest setRoot(DependencyNode root)

      Sets the root node of the dependency graph whose artifacts should be resolved. When this request is processed, the nodes of the given dependency graph will be updated to refer to the resolved artifacts. Eventually, either `setRoot(DependencyNode)` or `setCollectRequest(CollectRequest)` must be called to create a valid request.
      Parameters:
        `root` - The root node of the dependency graph, may be `null`.
      Returns:
        This request for chaining, never `null`.

    - #### getCollectRequest

          public CollectRequest getCollectRequest()

      Gets the collect request used to calculate the dependency graph whose artifacts should be resolved.
      Returns:
        The collect request or `null` if none.

    - #### setCollectRequest

          public DependencyRequest setCollectRequest(CollectRequest collectRequest)

      Sets the collect request used to calculate the dependency graph whose artifacts should be resolved. Eventually, either `setRoot(DependencyNode)` or `setCollectRequest(CollectRequest)` must be called to create a valid request. If this request is supplied with a dependency node via `setRoot(DependencyNode)`, the collect request is ignored.
      Parameters:
        `collectRequest` - The collect request, may be `null`.
      Returns:
        This request for chaining, never `null`.

    - #### getFilter

          public DependencyFilter getFilter()

      Gets the resolution filter used to select which artifacts of the dependency graph should be resolved.
      Returns:
        The resolution filter or `null` to resolve all artifacts of the dependency graph.

    - #### setFilter

          public DependencyRequest setFilter(DependencyFilter filter)

      Sets the resolution filter used to select which artifacts of the dependency graph should be resolved. For example, use this filter to restrict resolution to dependencies of a certain scope.
      Parameters:
        `filter` - The resolution filter, may be `null` to resolve all artifacts of the dependency graph.
      Returns:
        This request for chaining, never `null`.

    - #### getTrace

          public RequestTrace getTrace()

      Gets the trace information that describes the higher level request/operation in which this request is issued.
      Returns:
        The trace information about the higher level operation or `null` if none.

    - #### setTrace

          public DependencyRequest setTrace(RequestTrace trace)

      Sets the trace information that describes the higher level request/operation in which this request is issued.
      Parameters:
        `trace` - The trace information about the higher level operation, may be `null`.
      Returns:
        This request for chaining, never `null`.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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