Class InterceptorBindingsMatcher
java.lang.Object
org.microbean.bean.InterceptorBindingsMatcher
- All Implemented Interfaces:
BiPredicate<Collection<? extends NamedAttributeMap<?>>,,Collection<? extends NamedAttributeMap<?>>> Matcher<Collection<? extends NamedAttributeMap<?>>,Collection<? extends NamedAttributeMap<?>>>
public final class InterceptorBindingsMatcher
extends Object
implements Matcher<Collection<? extends NamedAttributeMap<?>>,Collection<? extends NamedAttributeMap<?>>>
A
Matcher encapsulating CDI-compatible interceptor binding
matching rules.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleantest(Collection<? extends NamedAttributeMap<?>> receiverAttributes, Collection<? extends NamedAttributeMap<?>> payloadAttributes) Returnstrueif and only if either (a) both the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare empty, or (b) if the collection of interceptor bindings present inpayloadAttributeshas only one element and that element is the any interceptor binding, or (c) the sizes of the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare the same and the collection of interceptor bindings present inreceiverAttributescontains all the collection of interceptor bindings present inpayloadAttributesand the collection of interceptor bindings present inpayloadAttributescontains all the collection of interceptor bindings present inreceiverAttributes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, negate, or
-
Constructor Details
-
InterceptorBindingsMatcher
public InterceptorBindingsMatcher()Creates a newInterceptorBindingsMatcher.
-
-
Method Details
-
test
public final boolean test(Collection<? extends NamedAttributeMap<?>> receiverAttributes, Collection<? extends NamedAttributeMap<?>> payloadAttributes) Returnstrueif and only if either (a) both the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare empty, or (b) if the collection of interceptor bindings present inpayloadAttributeshas only one element and that element is the any interceptor binding, or (c) the sizes of the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare the same and the collection of interceptor bindings present inreceiverAttributescontains all the collection of interceptor bindings present inpayloadAttributesand the collection of interceptor bindings present inpayloadAttributescontains all the collection of interceptor bindings present inreceiverAttributes.- Specified by:
testin interfaceBiPredicate<Collection<? extends NamedAttributeMap<?>>,Collection<? extends NamedAttributeMap<?>>> - Specified by:
testin interfaceMatcher<Collection<? extends NamedAttributeMap<?>>,Collection<? extends NamedAttributeMap<?>>> - Parameters:
receiverAttributes- aCollectionofNamedAttributeMaps; must not benullpayloadAttributes- aCollectionofNamedAttributeMaps; must not benull- Returns:
trueif and only if either (a) both the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare empty, or (b) if the collection of interceptor bindings present inpayloadAttributeshas only one element and that element is the any interceptor binding, or (c) the sizes of the collection of interceptor bindings present inreceiverAttributesand the collection of interceptor bindings present inpayloadAttributesare the same and the collection of interceptor bindings present inreceiverAttributescontains all the collection of interceptor bindings present inpayloadAttributesand the collection of interceptor bindings present inpayloadAttributescontains all the collection of interceptor bindings present inreceiverAttributes- Throws:
NullPointerException- if eitherreceiverAttributesorpayloadAttributesisnull
-