ComponentSelectionCause (Gradle API 9.1.0)
Description: declaration: package: org.gradle.api.artifacts.result, enum: ComponentSelectionCause

Package org.gradle.api.artifacts.result

# Enum ComponentSelectionCause

java.lang.Object
java.lang.Enum<ComponentSelectionCause>
org.gradle.api.artifacts.result.ComponentSelectionCause

All Implemented Interfaces:
  `Serializable`, `Comparable<ComponentSelectionCause>`, `java.lang.constant.Constable`

public enum ComponentSelectionCause extends Enum<ComponentSelectionCause>
The possible component selection causes. There are a limited number of causes, but each of them can be provided with a custom description, via `ComponentSelectionDescriptor`.

Since:
  4.6

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `BY_ANCESTOR`
  This component was selected because it was requested by a parent with a strict version.
  `COMPOSITE_BUILD`
  This component was selected as a participant of a composite.
  `CONFLICT_RESOLUTION`
  This component was selected between several candidates during conflict resolution.
  `CONSTRAINT`
  This component was selected because of a dependency constraint
  `FORCED`
  This component was selected because selection was forced on this version.
  `REJECTION`
  This component was selected because another version was rejected by a rule
  `REQUESTED`
  This component was selected because it was requested directly.
  `ROOT`
  This component was selected because it's the root component.
  `SELECTED_BY_RULE`
  This component was selected by a rule.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDefaultReason()`
  `static ComponentSelectionCause`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static ComponentSelectionCause[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### ROOT

    public static final ComponentSelectionCause ROOT
    This component was selected because it's the root component.

  - ### REQUESTED

    public static final ComponentSelectionCause REQUESTED
    This component was selected because it was requested directly.

  - ### SELECTED_BY_RULE

    public static final ComponentSelectionCause SELECTED_BY_RULE
    This component was selected by a rule.

  - ### FORCED

    public static final ComponentSelectionCause FORCED
    This component was selected because selection was forced on this version.

  - ### CONFLICT_RESOLUTION

    public static final ComponentSelectionCause CONFLICT_RESOLUTION
    This component was selected between several candidates during conflict resolution.

  - ### COMPOSITE_BUILD

    public static final ComponentSelectionCause COMPOSITE_BUILD
    This component was selected as a participant of a composite.

  - ### REJECTION

    public static final ComponentSelectionCause REJECTION
    This component was selected because another version was rejected by a rule

  - ### CONSTRAINT

    public static final ComponentSelectionCause CONSTRAINT
    This component was selected because of a dependency constraint

  - ### BY_ANCESTOR

    public static final ComponentSelectionCause BY_ANCESTOR
    This component was selected because it was requested by a parent with a strict version.
    Since:
      6.0

- ## Method Details

  - ### values

    public static ComponentSelectionCause[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static ComponentSelectionCause valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### getDefaultReason

    public String getDefaultReason()