Class AutoAddScopeBuildItem.Builder

java.lang.Object
io.quarkus.arc.deployment.AutoAddScopeBuildItem.Builder
Enclosing class:
AutoAddScopeBuildItem

public static class AutoAddScopeBuildItem.Builder extends Object
  • Method Details

    • requiresContainerServices

      public AutoAddScopeBuildItem.Builder requiresContainerServices()
      At least one injection point or lifecycle callback must be declared in the class hierarchy. Otherwise, the scope annotation is not added.

      Note that the detection algorithm is just the best effort. Some inheritance rules defined by the spec are not followed, e.g. per spec an initializer method is only inherited if not overridden. This method merely scans the annotations.

      Returns:
      self
    • unremovable

      public AutoAddScopeBuildItem.Builder unremovable()
      The bean will be unremovable.
      Returns:
      self
      See Also:
    • match

      Set a custom predicate.

      The previous predicate (if any) is replaced.

      Parameters:
      predicate -
      Returns:
      self
    • isAnnotatedWith

      public AutoAddScopeBuildItem.Builder isAnnotatedWith(org.jboss.jandex.DotName annotationName)
      The class must be annotated with the given annotation. Otherwise, the scope annotation is not added.

      The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.

      Parameters:
      annotationName -
      Returns:
      self
    • containsAnnotations

      public AutoAddScopeBuildItem.Builder containsAnnotations(org.jboss.jandex.DotName... annotationNames)
      The class or any of its element must be annotated with the given annotation. Otherwise, the scope annotation is not added.

      The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.

      Parameters:
      annotationNames -
      Returns:
      self
    • anyMethodMatches

      public AutoAddScopeBuildItem.Builder anyMethodMatches(Predicate<org.jboss.jandex.MethodInfo> predicate)
      The class declares a method that matches the given predicate.

      The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.

      Parameters:
      predicate -
      Returns:
      self
    • implementsInterface

      public AutoAddScopeBuildItem.Builder implementsInterface(org.jboss.jandex.DotName interfaceName)
      The class must directly or indirectly implement the given interface.

      The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.

      Parameters:
      interfaceName -
      Returns:
      self
    • defaultScope

      public AutoAddScopeBuildItem.Builder defaultScope(org.jboss.jandex.DotName scopeAnnotationName)
      The scope annotation added to the class.
      Parameters:
      scopeAnnotationName -
      Returns:
      self
    • defaultScope

      public AutoAddScopeBuildItem.Builder defaultScope(BuiltinScope scope)
      The scope annotation added to the class.
      Parameters:
      scope -
      Returns:
    • reason

      public AutoAddScopeBuildItem.Builder reason(String reason)
      Specify an optional reason description that is used in log messages.
      Parameters:
      reason -
      Returns:
      the reason why the scope annotation was added
    • priority

      public AutoAddScopeBuildItem.Builder priority(int priority)
      Set the priority. The default priority is 0. An AutoAddScopeBuildItem with higher priority takes precedence.
      Parameters:
      priority -
      Returns:
      self
    • scopeAlreadyAdded

      public AutoAddScopeBuildItem.Builder scopeAlreadyAdded(BiConsumer<org.jboss.jandex.DotName,String> consumer)
      If a scope was already added by another AutoAddScopeBuildItem then this consumer is used to handle this situation, i.e. log a warning or throw an exception. The first argument is the AutoAddScopeBuildItem.getDefaultScope() and the second argument is the AutoAddScopeBuildItem.getReason().
      Parameters:
      consumer -
      Returns:
      self
    • and

      The final predicate is a short-circuiting logical AND of the previous predicate (if any) and this condition.
      Parameters:
      other -
      Returns:
      self
    • build

      public AutoAddScopeBuildItem build()