Enum Class PackedClosures.PackMode

java.lang.Object
java.lang.Enum<PackedClosures.PackMode>
groovy.transform.PackedClosures.PackMode
All Implemented Interfaces:
Serializable, Comparable<PackedClosures.PackMode>, Constable
Enclosing class:
PackedClosures

@Incubating public static enum PackedClosures.PackMode extends Enum<PackedClosures.PackMode>
The packing behaviour of a PackedClosures scope. LENIENT, WARN and STRICT all pack, differing only in how they report a closure that could not be packed (declines are otherwise silent). DISABLED is the opposite: it opts the scope out of packing entirely, so the most-specific declaration wins — a DISABLED method inside a packed class, or vice versa, and it overrides the automatic groovy.target.closure.pack flag as well.
  • Enum Constant Details

    • DISABLED

      public static final PackedClosures.PackMode DISABLED
      Do not pack any closure in this scope; overrides an enclosing opt-in and the automatic flag.
    • LENIENT

      public static final PackedClosures.PackMode LENIENT
      Silently fall back to a generated closure class for any closure that cannot be packed (default).
    • WARN

      public static final PackedClosures.PackMode WARN
      Emit a compiler warning, naming the closure and why it declined, for each that cannot be packed.
    • STRICT

      public static final PackedClosures.PackMode STRICT
      Emit a compiler error for any closure in the scope that cannot be packed.
  • Method Details

    • values

      public static PackedClosures.PackMode[] 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 PackedClosures.PackMode 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