[cdi-dev] [JBoss JIRA] (CDI-605) Add some built in predicates

John Ament (JIRA) issues at jboss.org
Thu May 26 20:56:00 EDT 2016


John Ament created CDI-605:
------------------------------

             Summary: Add some built in predicates
                 Key: CDI-605
                 URL: https://issues.jboss.org/browse/CDI-605
             Project: CDI Specification Issues
          Issue Type: Feature Request
          Components: Javadoc and API
            Reporter: John Ament


During review, Antonin pointed out some useful predicates that should be reusable in the context of CDI.

https://github.com/astefanutti/camel-cdi/blob/0c9ae969c5721e655da3d396d17ec98a6f1aecaa/impl/src/main/java/org/apache/camel/cdi/CdiSpiHelper.java#L49-L57

{code}
    static Predicate<Bean> hasType(Type type) {
        requireNonNull(type);
        return bean -> bean.getTypes().contains(type);
    }

    static Predicate<Annotation> isAnnotationType(Class<? extends Annotation> clazz) {
        requireNonNull(clazz);
        return annotation -> clazz.equals(annotation.annotationType());
    }
{code}

We should consider adding them.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the cdi-dev mailing list