@Documented
@Retention(value=RUNTIME)
public @interface Dependent
Example:
Consider a field, lock
, that is only initialized if the
enclosing object (the receiver), is marked as ThreadSafe
.
Such a field can be declared as:
private @Nullable @Dependent(result=NonNull.class, when=ThreadSafe.class)
Lock lock;