# Enum ComponentSelectionCause

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

All Implemented Interfaces:
  `Serializable, Comparable<ComponentSelectionCause>, 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 Enum

  `Enum.EnumDesc<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()`
  Returns the default reason.
  `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 Enum

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

  ### Methods inherited from class 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.
    Since:
      4.6

  - ### REQUESTED

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

  - ### SELECTED_BY_RULE

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

  - ### FORCED

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

  - ### CONFLICT_RESOLUTION

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

  - ### COMPOSITE_BUILD

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

  - ### REJECTION

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

  - ### CONSTRAINT

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

  - ### 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()
    Returns the default reason.
    Since:
      4.6