Package io.quarkus.arc.processor
Class BeanStream
- java.lang.Object
-
- io.quarkus.arc.processor.BeanStream
-
public final class BeanStream extends Object implements Iterable<BeanInfo>
ConvenientStreamwrapper that can be used to filter a set of beans.This object is stateful and cannot be reused. After a terminal opration is performed, the underlying stream is considered consumed, and can no longer be used.
This construct is not threadsafe.
-
-
Constructor Summary
Constructors Constructor Description BeanStream(Collection<BeanInfo> beans)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
BeanStream
public BeanStream(Collection<BeanInfo> beans)
-
-
Method Detail
-
withScope
public BeanStream withScope(Class<? extends Annotation> scope)
- Parameters:
scopeName-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getScope()
-
withScope
public BeanStream withScope(org.jboss.jandex.DotName scopeName)
- Parameters:
scopeName-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getScope()
-
withBeanType
public BeanStream withBeanType(Class<?> beanType)
- Parameters:
beanType-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getTypes()
-
withBeanType
public BeanStream withBeanType(org.jboss.jandex.DotName beanTypeName)
- Parameters:
beanType-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getTypes()
-
withBeanType
public BeanStream withBeanType(org.jboss.jandex.Type beanType)
- Parameters:
beanType-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getTypes()
-
withBeanClass
public BeanStream withBeanClass(Class<?> beanClass)
- Parameters:
beanClass-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getBeanClass()
-
matchBeanTypes
public BeanStream matchBeanTypes(Predicate<Set<org.jboss.jandex.Type>> predicate)
- Parameters:
predicate-- Returns:
- the new stream of beans
-
withTarget
public BeanStream withTarget()
- Returns:
- the new stream of beans
- See Also:
BeanInfo.getTarget()
-
withBeanClass
public BeanStream withBeanClass(org.jboss.jandex.DotName beanClass)
- Parameters:
beanClass-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getBeanClass()
-
withQualifier
@SafeVarargs public final BeanStream withQualifier(Class<? extends Annotation>... qualifiers)
- Parameters:
qualifier-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getQualifiers()
-
withQualifier
public BeanStream withQualifier(org.jboss.jandex.DotName... qualifierNames)
- Parameters:
qualifierNames-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getQualifiers()
-
withName
public BeanStream withName(String name)
- Parameters:
name-- Returns:
- the new stream of beans
- See Also:
BeanInfo.getName()
-
withName
public BeanStream withName()
- Returns:
- the new stream of beans
- See Also:
BeanInfo.getName()
-
withAroundInvokeInterceptor
public BeanStream withAroundInvokeInterceptor()
- Returns:
- the new stream of beans that have an associated interceptor
-
withLifecycleInterceptor
public BeanStream withLifecycleInterceptor()
- Returns:
- the new stream of beans that have an associated lifecycle interceptor
-
findByIdentifier
public Optional<BeanInfo> findByIdentifier(String id)
- Parameters:
id-- Returns:
- an
Optionalwith the matching bean, or an emptyOptionalif no such bean is found - See Also:
BeanInfo.getIdentifier()
-
producers
public BeanStream producers()
- Returns:
- the new stream of producer beans
-
producerMethods
public BeanStream producerMethods()
- Returns:
- the new stream of producer method beans
-
producerFields
public BeanStream producerFields()
- Returns:
- the new stream of producer field beans
-
classBeans
public BeanStream classBeans()
- Returns:
- the new stream of class beans
-
syntheticBeans
public BeanStream syntheticBeans()
- Returns:
- the new stream of synthetic beans
-
namedBeans
public BeanStream namedBeans()
- Returns:
- the new stream of named beans
- See Also:
BeanInfo.getName()
-
defaultBeans
public BeanStream defaultBeans()
- Returns:
- the new stream of default beans
- See Also:
BeanInfo.isDefaultBean()
-
alternativeBeans
public BeanStream alternativeBeans()
- Returns:
- the new stream of default beans
- See Also:
BeanInfo.isAlternative()
-
assignableTo
public BeanStream assignableTo(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers)
- Parameters:
requiredType-requiredQualifiers-- Returns:
- the new stream of beans assignable to the required type and qualifiers
-
filter
public BeanStream filter(Predicate<BeanInfo> predicate)
- Parameters:
predicate-- Returns:
- the new stream
-
isEmpty
public boolean isEmpty()
Terminal operation.- Returns:
- true if the stream contains no elements
-
-