Package groovy.transform
Enum Class PackedClosures.PackMode
- All Implemented Interfaces:
Serializable,Comparable<PackedClosures.PackMode>,Constable
- Enclosing class:
- PackedClosures
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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDo not pack any closure in this scope; overrides an enclosing opt-in and the automatic flag.Silently fall back to a generated closure class for any closure that cannot be packed (default).Emit a compiler error for any closure in the scope that cannot be packed.Emit a compiler warning, naming the closure and why it declined, for each that cannot be packed. -
Method Summary
Modifier and TypeMethodDescriptionstatic PackedClosures.PackModeReturns the enum constant of this class with the specified name.static PackedClosures.PackMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DISABLED
Do not pack any closure in this scope; overrides an enclosing opt-in and the automatic flag. -
LENIENT
Silently fall back to a generated closure class for any closure that cannot be packed (default). -
WARN
Emit a compiler warning, naming the closure and why it declined, for each that cannot be packed. -
STRICT
Emit a compiler error for any closure in the scope that cannot be packed.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-