Debian Codegraph @

src/org/jetbrains/annotations/Async.java

raw symbols SCIP
1 /*
2 * Copyright 2000-2021 JetBrains s.r.o.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.jetbrains.annotations;
17
18 import java.lang.annotation.ElementType;
19 import java.lang.annotation.Retention;
20 import java.lang.annotation.RetentionPolicy;
21 import java.lang.annotation.Target;
22
23 /**
24 * Helper annotations for asynchronous computation.
25 * Used for example in IntelliJ IDEA's debugger for async stacktraces feature.
26 *
27 * @author egor
28 */
29 public final class Async {
30
31 /**
32 * Prohibited default constructor.
33 */
34 private Async() {
35 throw new AssertionError("Async should not be instantiated");
36 }
37
38 /**
39 * Indicates that the marked method schedules async computation.
40 * Scheduled object is either {@code this}, or the annotated parameter value.
41 */
42 @Retention(RetentionPolicy.CLASS)
43 @Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
44 public @interface Schedule {}
45
46 /**
47 * Indicates that the marked method executes async computation.
48 * Executed object is either {@code this}, or the annotated parameter value.
49 * This object needs to match with the one annotated with {@link Schedule}
50 */
51 @Retention(RetentionPolicy.CLASS)
52 @Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
53 public @interface Execute {}
54 }