Interface RuntimeBeanDefinition<T>

    • Field Summary

      • Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata

        CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
      • Fields inherited from interface io.micronaut.core.annotation.AnnotationSource

        EMPTY
    • Method Detail

      • getAnnotationMetadata

        @NonNull
        default io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
        Specified by:
        getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
      • isPresent

        default boolean isPresent()
        Specified by:
        isPresent in interface BeanDefinitionReference<T>
        Returns:
        Is the underlying bean type present on the classpath
      • of

        @NonNull
        static <B> RuntimeBeanDefinition<B> of​(@NonNull
                                               B bean)
        Creates a new effectively singleton bean definition that references the given bean.
        Type Parameters:
        B - The bean type
        Parameters:
        bean - The bean
        Returns:
        The BeanDefinitionReference
        Since:
        3.6.0
      • of

        @NonNull
        static <B> RuntimeBeanDefinition<B> of​(@NonNull
                                               java.lang.Class<B> beanType,
                                               @NonNull
                                               java.util.function.Supplier<B> beanSupplier)
        Creates a new bean definition that will resolve the bean from the given supplier.

        The bean is by default not singleton and the supplier will be invoked for each injection point.

        Type Parameters:
        B - The bean type
        Parameters:
        beanType - The bean type
        beanSupplier - The bean supplier
        Returns:
        The BeanDefinitionReference
        Since:
        3.6.0
      • builder

        @NonNull
        static <B> RuntimeBeanDefinition.Builder<B> builder​(@NonNull
                                                            B bean)
        A new builder for constructing and configuring runtime created beans.
        Type Parameters:
        B - The bean type
        Parameters:
        bean - The bean to use
        Returns:
        The builder
      • builder

        @NonNull
        static <B> RuntimeBeanDefinition.Builder<B> builder​(@NonNull
                                                            java.lang.Class<B> beanType,
                                                            @NonNull
                                                            java.util.function.Supplier<B> beanSupplier)
        A new builder for constructing and configuring runtime created beans.
        Type Parameters:
        B - The bean type
        Parameters:
        beanType - The bean type
        beanSupplier - The bean supplier
        Returns:
        The builder
      • builder

        @NonNull
        static <B> RuntimeBeanDefinition.Builder<B> builder​(@NonNull
                                                            io.micronaut.core.type.Argument<B> beanType,
                                                            @NonNull
                                                            java.util.function.Supplier<B> beanSupplier)
        A new builder for constructing and configuring runtime created beans.
        Type Parameters:
        B - The bean type
        Parameters:
        beanType - The bean type
        beanSupplier - The bean supplier
        Returns:
        The builder