java.lang.Object
org.microbean.bean.TypeMatcher
- All Implemented Interfaces:
Constable,BiPredicate<TypeMirror,,TypeMirror> Matcher<TypeMirror,TypeMirror>
A
Matcher encapsulating CDI-compatible
type matching rules.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Optional<? extends ConstantDesc> final booleantest(TypeMirror receiver, TypeMirror payload) Returnstrueif and only if the suppliedpayloadargument matches the suppliedreceiverargument, according to the rules defined by section 2.4.2.1 of the CDI specification.final TypeAndElementSourceReturns theTypeAndElementSourceused by thisTypeMatcher.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
-
TypeMatcher
Creates a newTypeMatcher.- Parameters:
tes- aTypeAndElementSource; must not benull- Throws:
NullPointerException- iftesisnull- See Also:
-
-
Method Details
-
describeConstable
Returns anOptionalhousing aConstantDescthat represents thisTypeMatcher.This method never returns
null.The default implementation of this method relies on the presence of a
publicconstructor that accepts a singleTypeAndElementSource-typed argument.The
Optionalreturned by an invocation of this method may be, and often will be, empty.- Specified by:
describeConstablein interfaceConstable- Returns:
- an
Optionalhousing aConstantDescthat represents thisTypeMatcher; nevernull - See Also:
-
test
Returnstrueif and only if the suppliedpayloadargument matches the suppliedreceiverargument, according to the rules defined by section 2.4.2.1 of the CDI specification.- Specified by:
testin interfaceBiPredicate<TypeMirror,TypeMirror> - Specified by:
testin interfaceMatcher<TypeMirror,TypeMirror> - Parameters:
receiver- the left hand side of a type assignment; must not benullpayload- the right hand side of a type assignment; must not benull- Returns:
trueif and only if the suppliedpayloadargument matches the suppliedreceiverargument, according to the rules defined by section 2.4.2.1 of the CDI specification;falseotherwise- Throws:
NullPointerException- if either argument isnullIllegalArgumentException- if either type is any type other than an array type, aprimitive type, or a declared type
-
typeAndElementSource
Returns theTypeAndElementSourceused by thisTypeMatcher.- Returns:
- the
TypeAndElementSourceused by thisTypeMatcher; nevernull - See Also:
-