This annotation denotes that the annotated type is immutable and eventually
it becomes thread-safe. By definition, a class is considered to be an
immutable class in which the state of its instance cannot be
observed
to be changed. So, inherently this implies that,
- All of its public fields must be declared as
final
- All of its public final reference fields are either
null
or refer
to other immutable objects
- Constructors and methods do not contain references to any potentially
mutable internal state.
In addition, the immutable objects are inherently thread-safe and that is the
reason, they can be passed between threads or published without explicit
synchronization or locks.