Package groovy.transform
Annotation Type ImmutableOptions
-
@Documented @Retention(SOURCE) @Target(TYPE) public @interface ImmutableOptionsClass annotation used to assist in the creation of immutable classes. Defines any known immutable properties (or fields) or known immutable classes.- Since:
- 2.5.0
- See Also:
Immutable,ImmutablePropertyHandler
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class[]knownImmutableClassesAllows you to provide@Immutablewith a list of classes which are deemed immutable.java.lang.String[]knownImmutablesAllows you to provide@Immutablewith a list of property names which are deemed immutable.
-
-
-
Element Detail
-
knownImmutableClasses
java.lang.Class[] knownImmutableClasses
Allows you to provide@Immutablewith a list of classes which are deemed immutable. By supplying a class in this list, you are vouching for its immutability and@Immutablewill do no further checks. Example:import groovy.transform.*
@Immutable(knownImmutableClasses = [Address]) class Person { String first, last Address address }@TupleConstructorclass Address { final String street }- Default:
- {}
-
-
-
knownImmutables
java.lang.String[] knownImmutables
Allows you to provide@Immutablewith a list of property names which are deemed immutable. By supplying a property's name in this list, you are vouching for its immutability and@Immutablewill do no further checks. Example:@groovy.transform.Immutable(knownImmutables = ['address']) class Person { String first, last Address address } ...- Default:
- {}
-
-