• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc.  All rights reserved.
3 //
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file or at
6 // https://developers.google.com/open-source/licenses/bsd
7 
8 package com.google.protobuf;
9 
10 import static java.lang.annotation.ElementType.CONSTRUCTOR;
11 import static java.lang.annotation.ElementType.METHOD;
12 import static java.lang.annotation.ElementType.PACKAGE;
13 import static java.lang.annotation.ElementType.TYPE;
14 import static java.lang.annotation.RetentionPolicy.RUNTIME;
15 
16 import java.lang.annotation.Documented;
17 import java.lang.annotation.Retention;
18 import java.lang.annotation.Target;
19 
20 /**
21  * Indicates that the return value of the annotated method must be used. An error is triggered when
22  * one of these methods is called but the result is not used.
23  *
24  * <p>{@code @CheckReturnValue} may be applied to a class or package to indicate that all methods in
25  * that class (including indirectly; that is, methods of inner classes within the annotated class)
26  * or package must have their return values used. For convenience, we provide an annotation, {@link
27  * CanIgnoreReturnValue}, to exempt specific methods or classes from this behavior.
28  */
29 @Documented
30 @Target({METHOD, CONSTRUCTOR, TYPE, PACKAGE})
31 @Retention(RUNTIME)
32 @interface CheckReturnValue {}
33