@Documented @Retention(value=RUNTIME) @Target(value={METHOD,CONSTRUCTOR}) @PostconditionAnnotation(qualifier=KeyFor.class) @InheritedAnnotation @Repeatable(value=EnsuresKeyFor.List.class) public @interface EnsuresKeyFor
Consider the following method from java.util.Map
:
@EnsuresKeyFor(value="key", map="this") public @Nullable V put(K key, V value) { ... }
This method guarantees that key
has type @KeyFor("this")
after the method
returns.
KeyFor
,
EnsuresKeyForIf
public abstract String[] value
@JavaExpression @QualifierArgument(value="value") public abstract String[] map