|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Documented
@Inherited
@Restriction
@Retention(value=SOURCE)
@Target(value={TYPE,METHOD})
public @interface Transparent
Transparent is a Restriction that applies to methods that are
referentially transparent - their invocations can be replaced by its return
value. In other words, are SideEffectFree and return always equal
results for equals arguments.
When applied to types, it means that all its methods are Transparent.
As a consequence, statefull classes that are annotated this way
must be immutable, as otherwise, changes of state would
eventually impact on changes in results. Thus there is no reason no annotate
Transparent classes as Immutable, as it is implicit.
SideEffectFree necessary for being Transparent, there
is no reason no annotate Transparent classes or methods as
SideEffectFree, as it is implicit.
As a consequence of being Immutable, Transparent classes are
thread safe.
SideEffectFree,
Immutable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||