Package io.micronaut.context.exceptions
Class NonUniqueBeanException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.micronaut.context.exceptions.BeanContextException
-
- io.micronaut.context.exceptions.NoSuchBeanException
-
- io.micronaut.context.exceptions.NonUniqueBeanException
-
- All Implemented Interfaces:
java.io.Serializable
public class NonUniqueBeanException extends NoSuchBeanException
Exception thrown when a bean is not unique and has multiple possible implementations for a given bean type.- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NonUniqueBeanException(java.lang.Class targetType, java.util.Iterator<BeanDefinition<T>> candidates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.lang.Class<T>
getBeanType()
<T> java.util.Iterator<BeanDefinition<T>>
getPossibleCandidates()
-
-
-
Constructor Detail
-
NonUniqueBeanException
public NonUniqueBeanException(java.lang.Class targetType, java.util.Iterator<BeanDefinition<T>> candidates)
- Type Parameters:
T
- The type- Parameters:
targetType
- The target typecandidates
- The bean definition candidates
-
-
Method Detail
-
getPossibleCandidates
public <T> java.util.Iterator<BeanDefinition<T>> getPossibleCandidates()
- Type Parameters:
T
- The type- Returns:
- The possible bean candidates
-
getBeanType
public <T> java.lang.Class<T> getBeanType()
- Type Parameters:
T
- The type- Returns:
- The bean type requested
-
-