|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Documented @Retention(value=SOURCE) @Target(value=TYPE) public @interface Applicative
Applicable is an annotation for abstract types that have
code-block/command/strategy/closure/lambda semantics, with an only abstract
method that implements such code, called applicative method.
In order to remain as general purposes as possible, such types does not
impose any Restriction over the type itself nor its applicative
method. There are however some recommendations for implementing it, that will
maximize the reusability of concrete classes.
Transparent, or at least
SideEffectFree. An obvious case where this is not generally possible
is for Applicable that return Void, which will be applied for
its side effects onlyImmutable, regardless
they are SideEffectFree or notSerializable
Methods that return Applicatives must be
NonNull and Transparent.
In addition, methods that return Applicatives and are annotated with
restrictions, alter Restriction semantic in some way: they do not
indicate that the method is restricted, but that the applicative's method is
restricted. For example, in the following code:
@Transparent Thunk<Integer> foo();The
Transparent annotations does not indicate that method foo() is
transparent, but that the applicative method of the returned Thunks, that is,
Thunk.value(), is transparent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||