Interface InjectionRequest<C>


@Immutable @API(status=STABLE) public interface InjectionRequest<C>
  • Method Details

    • of

      static <C> @NonNull InjectionRequest<C> of(@NonNull CommandContext<C> context, @NonNull TypeToken<?> injectedType, @NonNull AnnotationAccessor annotationAccessor)
      Creates a new injection request.
      Type Parameters:
      C - command sender type
      Parameters:
      context - context associated with the request
      injectedType - type that is being injected
      annotationAccessor - associated annotation accessor
      Returns:
      the request
    • of

      static <C> @NonNull InjectionRequest<C> of(@NonNull CommandContext<C> context, @NonNull TypeToken<?> injectedType)
      Creates a new injection request.
      Type Parameters:
      C - command sender type
      Parameters:
      context - context associated with the request
      injectedType - type that is being injected
      Returns:
      the request
    • commandContext

      @NonNull CommandContext<C> commandContext()
      Returns the context associated with the request.
      Returns:
      the context
    • injectedType

      @NonNull TypeToken<?> injectedType()
      Returns the type that is being injected.
      Returns:
      the injected type
    • injectedClass

      @Derived default @NonNull Class<?> injectedClass()
      Returns the type that is being injected.
      Returns:
      the injected type
    • annotationAccessor

      @NonNull AnnotationAccessor annotationAccessor()
      Returns an annotation accessor that can be used to access the annotations of the field that is being injected.

      If no field is injected then AnnotationAccessor.empty() will be returned.

      Returns:
      the annotation accessor