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 | Class and Description |
|---|---|
| public static @interface | EnsuresKeyFor.List
A wrapper annotation that makes the |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | Returns: Java expressions whose values are maps, each of which contains each expression value as a key (after successful method termination)Returns Java expressions whose values are maps, each of which contains each expression value as a key (after successful method termination). |
| public String[] |
| map | back to summary |
|---|---|
| public String[] map() Returns Java expressions whose values are maps, each of which contains each expression value as a key (after successful method termination).
| |
| value | back to summary |
|---|---|
| public String[] value() Java expressions that are keys in the given maps on successful method termination. | |
EnsuresKeyFor annotation repeatable.
Programmers generally do not need to write this. It is created by Java when a programmer
writes more than one EnsuresKeyFor annotation at the same location.
| Modifier and Type | Method and Description |
|---|---|
| public EnsuresKeyFor[] |
| value | back to summary |
|---|---|
| public EnsuresKeyFor[] value() Returns the repeatable annotations.
| |