Package groovy.transform

# Enum Class AnnotationCollectorMode

java.lang.Object
java.lang.Enum<AnnotationCollectorMode>
groovy.transform.AnnotationCollectorMode

All Implemented Interfaces:
  `Serializable`, `Comparable<AnnotationCollectorMode>`, `Constable`

public enum AnnotationCollectorMode extends Enum<AnnotationCollectorMode>
Conflict resolution modes for `AnnotationCollector`.

Since:
  2.0.0

- ## 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
  `DUPLICATE`
  Annotations from the annotation collection will always be inserted.
  `PREFER_COLLECTOR`
  Annotations from the collector will be added and any existing annotations with the same name will be removed.
  `PREFER_COLLECTOR_MERGED`
  Annotations from the collector will be added and any existing annotations with the same name will be removed but any new parameters found within existing annotations will be merged into the added annotation.
  `PREFER_EXPLICIT`
  Annotations from the collector will be ignored if any existing annotations with the same name are found.
  `PREFER_EXPLICIT_MERGED`
  Annotations from the collector will be ignored if any existing annotations with the same name are found but any new parameters on the collector annotation will be added to existing annotations.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static AnnotationCollectorMode`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static AnnotationCollectorMode[]`
  `values()`
  Returns an array containing the constants of this enum class, 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

  - ### DUPLICATE

    public static final AnnotationCollectorMode DUPLICATE
    Annotations from the annotation collection will always be inserted. After all transforms have been run, it will be an error if multiple annotations (excluding those with SOURCE retention) exist.

  - ### PREFER_COLLECTOR

    public static final AnnotationCollectorMode PREFER_COLLECTOR
    Annotations from the collector will be added and any existing annotations with the same name will be removed.

  - ### PREFER_EXPLICIT

    public static final AnnotationCollectorMode PREFER_EXPLICIT
    Annotations from the collector will be ignored if any existing annotations with the same name are found.

  - ### PREFER_COLLECTOR_MERGED

    public static final AnnotationCollectorMode PREFER_COLLECTOR_MERGED
    Annotations from the collector will be added and any existing annotations with the same name will be removed but any new parameters found within existing annotations will be merged into the added annotation.

  - ### PREFER_EXPLICIT_MERGED

    public static final AnnotationCollectorMode PREFER_EXPLICIT_MERGED
    Annotations from the collector will be ignored if any existing annotations with the same name are found but any new parameters on the collector annotation will be added to existing annotations.

- ## Method Details

  - ### values

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

  - ### valueOf

    public static AnnotationCollectorMode valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      `NullPointerException` - if the argument is null