@Retention(SOURCE)
@Target(CONSTRUCTOR)
public @interface ImmutableConstructor
The constructor must have the same arguments and types as the properties as exposed by the builder. They must also be in the same order. The constructor is responsible for maintaining the invariants of the class, such as validation.
For example, a property type of 'ImmutableList<Foo>' will have a builder type of 'List<Foo>', thus the constructor must also use 'List'.
If no constructor specifies this annotation then a constructor will be generated. In many cases it is easiest to generate the constructor, then move it outside the autogenerated block and annotate it.
Copyright © 2007–2018 Joda.org. All rights reserved.