Package io.micronaut.context
Interface RuntimeBeanDefinition.Builder<B>
- Type Parameters:
B
- The bean type
- Enclosing interface:
- RuntimeBeanDefinition<T>
public static interface RuntimeBeanDefinition.Builder<B>
A builder for constructing
RuntimeBeanDefinition
instances.-
Method Summary
Modifier and TypeMethodDescriptionannotationMetadata
(@Nullable AnnotationMetadata annotationMetadata) The annotation metadata for the bean.build()
Builds the runtime bean.exposedTypes
(Class<?>... types) Limit the exposed types of this bean.default @NonNull RuntimeBeanDefinition.Builder<B>
The qualifier to use.The qualifier to use.Adds this type as a bean replacement of the given type.scope
(@Nullable Class<? extends Annotation> scope) The scope to use.singleton
(boolean isSingleton) Is the bean singleton.typeArguments
(Argument<?>... arguments) The type arguments for the type.typeArguments
(Class<?> implementedType, Argument<?>... arguments) The type arguments for an implemented type of this type.
-
Method Details
-
qualifier
@NonNull @NonNull RuntimeBeanDefinition.Builder<B> qualifier(@Nullable @Nullable Qualifier<B> qualifier) The qualifier to use.- Parameters:
qualifier
- The qualifier- Returns:
- This builder
-
replaces
@NonNull @NonNull RuntimeBeanDefinition.Builder<B> replaces(@Nullable @Nullable Class<? extends B> otherType) Adds this type as a bean replacement of the given type.- Parameters:
otherType
- The other type- Returns:
- This bean builder
- Since:
- 4.0.0
-
named
The qualifier to use.- Parameters:
name
- The named qualifier to use.- Returns:
- This builder
- Since:
- 3.7.0
-
scope
@NonNull @NonNull RuntimeBeanDefinition.Builder<B> scope(@Nullable @Nullable Class<? extends Annotation> scope) The scope to use.- Parameters:
scope
- The scope- Returns:
- This builder
-
singleton
Is the bean singleton.- Parameters:
isSingleton
- True if it is singleton- Returns:
- This builder
-
exposedTypes
Limit the exposed types of this bean.- Parameters:
types
- The exposed types- Returns:
- This builder
-
typeArguments
The type arguments for the type.- Parameters:
arguments
- The arguments- Returns:
- This builder
-
typeArguments
@NonNull @NonNull RuntimeBeanDefinition.Builder<B> typeArguments(Class<?> implementedType, Argument<?>... arguments) The type arguments for an implemented type of this type.- Parameters:
implementedType
- The implemented typearguments
- The arguments- Returns:
- This builder
-
annotationMetadata
@NonNull @NonNull RuntimeBeanDefinition.Builder<B> annotationMetadata(@Nullable @Nullable AnnotationMetadata annotationMetadata) The annotation metadata for the bean.- Parameters:
annotationMetadata
- The annotation metadata- Returns:
- This builder
-
build
Builds the runtime bean.- Returns:
- The runtime bean
-