@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
Modifier and Type | Required Element and Description |
---|---|
String[] |
map
Returns Java expressions whose values are maps, each of which contains each expression value as
a key (after successful method termination).
|
String[] |
value
Java expressions that are keys in the given maps on successful method termination.
|
public abstract String[] value
@JavaExpression @QualifierArgument(value="value") public abstract String[] map