Package org.springframework.lang

# Annotation Interface CheckReturnValue

@Documented @Target(METHOD) public @interface CheckReturnValue
Specifies that the method return value must be used.

Inspired by `org.jetbrains.annotations.CheckReturnValue`, this variant has been introduced in the `org.springframework.lang` package to avoid requiring an extra dependency, while still following similar semantics.

This annotation should not be used if the return value of the method provides only additional information. For example, the main purpose of `Collection.add(Object)` is to modify the collection and the return value is only interesting when adding an element to a set, to see if the set already contained that element before.

Since:
  6.2
Author:
  Sebastien Deleuze