|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Documented
@Inherited
@Restriction
@Retention(value=SOURCE)
@Target(value={TYPE,METHOD})
public @interface Conditionally
Conditionally is a restriction modifier that indicates that an
objects may meet set of restrictions depending on some condition. There are
two standard scenarios:
Types annotated as Conditionally denote that all their instances
grant to conditionally meet the set constraints, depending on the attributes
injected by constructor or setters, or in its constructor type parameters.
Methods annotated as Unmodifiable denote that all the objects
returned by them conditionally meet the set constraints, depending on the
method type parametrization, the receptor object this and arguments.
Typical example of @Conditionally(Immutable.class) objects are
Lists returned by Collections.singletonList(Object), which are
immutable as long as its argument is immutable too.
| Required Element Summary | |
|---|---|
Class[] |
value
An array with interfaces and/or restriction annotations |
| Element Detail |
|---|
public abstract Class[] value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||