Package: org.gradle.api.artifacts.result

## [Java] Interface ResolvedComponentResult

- Represents a component instance in the resolved dependency graph. Provides some basic identity and dependency information about the component.

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `Set<? extends DependencyResult>` | `getDependencies()`
    `Set<? extends ResolvedDependencyResult>` | `getDependents()` Returns the incoming dependencies of this component.
    `ComponentIdentifier` | `getId()`
    `ModuleVersionIdentifier` | `getModuleVersion()` Returns the module version which this component belongs to, if any.
    `ComponentSelectionReason` | `getSelectionReason()` Returns the reason why this particular component was selected in the result.

- - ### Method Detail

    - #### public Set<? extends DependencyResult> getDependencies()

      Returns the dependencies of this component. Includes resolved and unresolved dependencies (if any).

      The elements of the returned collection are declared as DependencyResult, however the dependency instances will also implement one of the following instances:

      - ResolvedDependencyResult for dependencies which were successfully resolved.
      - UnresolvedDependencyResult for dependencies which could not be resolved for some reason.
      Returns:
        the dependencies of this component

    - #### public Set<? extends ResolvedDependencyResult> getDependents()

      Returns the incoming dependencies of this component.

      Returns:
        the dependents of this component

    - #### public ComponentIdentifier getId()

      Returns the identifier of this component. This can be used to uniquely identify the component within the current build, but it is not necessarily unique between different builds.

      The return type is declared as an opaque ComponentIdentifier, however the identifier may also implement one of the following interfaces:

      - ProjectComponentIdentifier for those component instances which are produced by the current build.
      - ModuleComponentIdentifier for those component instances which are found in some repository.
      Returns:
        the identifier of this component

    - #### @Nullable public ModuleVersionIdentifier getModuleVersion()

      Returns the module version which this component belongs to, if any. A component will belong to a module version if it was found in some repository, or if the module version for the component has been declared, usually by declaring how the component should be published.

      Returns:
        the module version of the component, or `null` if this component has no associated module version.

    - #### public ComponentSelectionReason getSelectionReason()

      Returns the reason why this particular component was selected in the result. Useful if multiple candidate components were found during dependency resolution.

      Returns:
        the reason for selecting the component