ComponentSelectionCause (Gradle API 4.7)
Date: 2018-04-18

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>

      @Incubating
      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

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `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

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

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

- - ### Enum Constant Detail

    - #### 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

  - ### Method Detail

    - #### values

          public static ComponentSelectionCause[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (ComponentSelectionCause c : ComponentSelectionCause.values())
              System.out.println(c);

      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()