Class EventQualifiersMatcher
java.lang.Object
org.microbean.event.EventQualifiersMatcher
- All Implemented Interfaces:
BiPredicate<Collection<? extends AnnotationMirror>, Collection<? extends AnnotationMirror>>, Matcher<Collection<? extends AnnotationMirror>, Collection<? extends AnnotationMirror>>
public final class EventQualifiersMatcher
extends Object
implements Matcher<Collection<? extends AnnotationMirror>, Collection<? extends AnnotationMirror>>
A
Matcher encapsulating CDI-compatible event
qualifier matching rules.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEventQualifiersMatcher(Qualifiers qualifiers) Creates a newEventQualifiersMatcher. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleantest(Collection<? extends AnnotationMirror> receiverAnnotations, Collection<? extends AnnotationMirror> payloadAnnotations) Returnstrueif and only if either the qualifiers present inreceiverAnnotationsare empty, or if the collection of qualifiers present inpayloadAnnotationscontains all of the qualifiers present inreceiverAnnotations.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BiPredicate
and, negate, or
-
Constructor Details
-
EventQualifiersMatcher
Creates a newEventQualifiersMatcher.- Parameters:
qualifiers- aQualifiers; must not benull- Throws:
NullPointerException- ifqualifiersisnull
-
-
Method Details
-
test
public final boolean test(Collection<? extends AnnotationMirror> receiverAnnotations, Collection<? extends AnnotationMirror> payloadAnnotations) Returnstrueif and only if either the qualifiers present inreceiverAnnotationsare empty, or if the collection of qualifiers present inpayloadAnnotationscontains all of the qualifiers present inreceiverAnnotations.- Specified by:
testin interfaceBiPredicate<Collection<? extends AnnotationMirror>, Collection<? extends AnnotationMirror>>- Specified by:
testin interfaceMatcher<Collection<? extends AnnotationMirror>, Collection<? extends AnnotationMirror>>- Parameters:
receiverAnnotations- aCollectionofAnnotationMirrorinstances; must not benullpayloadAnnotations- aCollectionofAnnotationMirrorinstances; must not benull- Returns:
trueif and only if either the qualifiers present inreceiverAnnotationsare empty, or if the collection of qualifiers present inpayloadAnnotationscontains all of the qualifiers present inreceiverAnnotations- Throws:
NullPointerException- if either argument isnull
-