Package groovy.transform
Enum SealedMode
- All Implemented Interfaces:
- Serializable,- Comparable<SealedMode>,- java.lang.constant.Constable
Intended mode to use for sealed classes when using the 
@Sealed annotation (or sealed keyword).- Since:
- 4.0.0
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.lang.EnumEnum.EnumDesc<E extends Enum<E>>
- 
Enum Constant SummaryEnum ConstantsEnum ConstantDescriptionProduce native sealed classes when compiling for a suitable target bytecode (JDK17+) and automatically emulate the concept on earlier JDKs.Indicate the sealed nature using annotations.Produce Java-like code with sealed nature indicated by "native" bytecode information (JEP 360/397/409).
- 
Method SummaryModifier and TypeMethodDescriptionstatic SealedModeReturns the enum constant of this type with the specified name.static SealedMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
- 
Enum Constant Details- 
EMULATEIndicate the sealed nature using annotations. This allows sealed hierarchies in earlier JDKs but for integration purposes won't be recognised by Java.
- 
NATIVEProduce Java-like code with sealed nature indicated by "native" bytecode information (JEP 360/397/409). Produces a compile-time error when used on earlier JDKs.
- 
AUTOProduce native sealed classes when compiling for a suitable target bytecode (JDK17+) and automatically emulate the concept on earlier JDKs.
 
- 
- 
Method Details- 
valuesReturns 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
 
- 
valueOfReturns 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
 
 
-