View Javadoc
1   /*
2    * MIT License
3    * Copyright (c) 2006-2025 JMockit developers
4    * See LICENSE file for full license text.
5    */
6   package mockit.asm.metadata;
7   
8   import edu.umd.cs.findbugs.annotations.NonNull;
9   import edu.umd.cs.findbugs.annotations.Nullable;
10  
11  import java.util.List;
12  
13  import mockit.asm.metadata.ClassMetadataReader.AnnotationInfo;
14  
15  class ObjectWithAttributes {
16      @Nullable
17      public List<AnnotationInfo> annotations;
18  
19      public final boolean hasAnnotation(@NonNull String annotationName) {
20          if (annotations != null) {
21              for (AnnotationInfo annotation : annotations) {
22                  if (annotationName.equals(annotation.name)) {
23                      return true;
24                  }
25              }
26          }
27  
28          return false;
29      }
30  }