hasAnnotation<A> method

bool hasAnnotation<A>()
inherited

Returns true if this definition has an annotation of type A.

Example:

if (def.hasAnnotation<Scope>()) {
  print("Scoped pod detected");
}

Implementation

bool hasAnnotation<A>() => annotations.find((a) => a.getInstance() is A) != null
  || annotatedClasses.find((c) => c.getType() == A) != null
  || annotatedClasses.find((c) => c == Class<A>()) != null;