Top Description Methods
groovy.transform

public @Interface ImmutableOptions

extends Annotation
Annotations
@Documented
@Retention:SOURCE
@Target:TYPE
Imports
groovy.transform.options.ImmutablePropertyHandler, java.lang.annotation.ElementType, .Retention, .RetentionPolicy, .Target

Class 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

Method Summary

Modifier and TypeMethod and Description
public Class<T>[]
knownImmutableClasses()

Allows you to provide @Immutable with a list of classes which are deemed immutable.

public String[]
knownImmutables()

Allows you to provide @Immutable with a list of property names which are deemed immutable.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

knownImmutableClassesback to summary
public Class<T>[] knownImmutableClasses()

Allows you to provide @Immutable with a list of classes which are deemed immutable. By supplying a class in this list, you are vouching for its immutability and @Immutable will do no further checks. Example:

import groovy.transform.*
@Immutable(knownImmutableClasses = [Address])
class Person {
    String first, last
    Address address
}

@TupleConstructor
class Address {
    final String street
}
knownImmutablesback to summary
public String[] knownImmutables()

Allows you to provide @Immutable with 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 @Immutable will do no further checks. Example:

@groovy.transform.Immutable(knownImmutables = ['address'])
class Person {
    String first, last
    Address address
}
...