Top Description Inners Methods
org.checkerframework.checker.nullness.qual

public @Interface EnsuresKeyFor

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:METHOD, CONSTRUCTOR
@PostconditionAnnotation
qualifier:KeyFor
@InheritedAnnotation
@Repeatable:List
Imports
java.lang.annotation.Documented, .ElementType, .Repeatable, .Retention, .RetentionPolicy, .Target, org.checkerframework.framework.qual.InheritedAnnotation, .JavaExpression, .PostconditionAnnotation, .QualifierArgument

Indicates that the value expressions evaluate to a value that is a key in all the given maps, if the method terminates successfully.

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.

See Also
KeyFor, EnsuresKeyForIf

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static @interface
EnsuresKeyFor.List

A wrapper annotation that makes the EnsuresKeyFor annotation repeatable.

Method Summary

Modifier and TypeMethod 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)
map
()

Returns Java expressions whose values are maps, each of which contains each expression value as a key (after successful method termination).

public String[]
value()

Java expressions that are keys in the given maps on successful method termination.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

mapback 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).

Returns:String[]

Java expressions whose values are maps, each of which contains each expression value as a key (after successful method termination)

Annotations
@JavaExpression
@QualifierArgument:value
valueback to summary
public String[] value()

Java expressions that are keys in the given maps on successful method termination.

org.checkerframework.checker.nullness.qual back to summary

public @Interface EnsuresKeyFor.List

extends Annotation
Annotations
@Documented
@Retention:RUNTIME
@Target:METHOD, CONSTRUCTOR
@PostconditionAnnotation
qualifier:KeyFor
@InheritedAnnotation

A wrapper annotation that makes the 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.

Method Summary

Modifier and TypeMethod and Description
public EnsuresKeyFor[]

Returns:

the repeatable annotations
value
()

Returns the repeatable annotations.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

valueback to summary
public EnsuresKeyFor[] value()

Returns the repeatable annotations.

Returns:EnsuresKeyFor[]

the repeatable annotations