有没有办法在地图中存储对象的注释?
class HasFieldsWithAnnotations {
Set<Annotation> annots = new HashSet<>();
public boolean hasAnnotation(Annotation a) {
return this.annots.contains(a);
}
}
然后我们实例化它:
var c = new HasFieldsWithAnnotations();
c.hasAnnotation(?);
如何将注释传递给hasAnnotation方法?