ComponentSelectionReason (Gradle API 2.14.1)

Package: org.gradle.api.artifacts.result

## [Java] Interface ComponentSelectionReason

- Answers the question why a component was selected during the dependency resolution.

  Since:
    1.3

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `String` | `getDescription()` Returns a human-consumable description of this selection reason.
    `boolean` | `isConflictResolution()` Informs whether the component was selected by conflict resolution.
    `boolean` | `isExpected()` Informs whether the component is the requested selection of all dependency declarations, and was not replaced for some reason, such as conflict resolution.
    `boolean` | `isForced()` Informs whether the component was forced.
    `boolean` | `isSelectedByRule()` Informs whether the component was selected by the dependency substitution rule.

- - ### Method Detail

    - #### public String getDescription()

      Returns a human-consumable description of this selection reason.

    - #### public boolean isConflictResolution()

      Informs whether the component was selected by conflict resolution. For more information about Gradle's conflict resolution please refer to the user guide. ResolutionStrategy contains information about conflict resolution and includes means to configure it.

    - #### public boolean isExpected()

      Informs whether the component is the requested selection of all dependency declarations, and was not replaced for some reason, such as conflict resolution.

      Since:
        1.11

    - #### public boolean isForced()

      Informs whether the component was forced. Users can force components via ResolutionStrategy or when declaring dependencies (see DependencyHandler).

    - #### public boolean isSelectedByRule()

      Informs whether the component was selected by the dependency substitution rule. Users can configure dependency substitution rules via ResolutionStrategy.getDependencySubstitution

      Since:
        1.4