Interface ExtractingTypePatternMatcher
- All Superinterfaces:
TypePatternMatcher
A pattern-matching implementation for generic types that also extracts a type from matching types.
For example, such a pattern could be described with the expression Collection<T> => T.
It would only match against Collection and its subclasses,
and would extract the resolved type for parameter T in the event of a match.
-
Method Summary
Modifier and TypeMethodDescriptionOptional<? extends PojoTypeModel<?>>extract(PojoTypeModel<?> typeToInspect) Attempts to match a given type against this pattern, and if matched, returns an upper bound of the extracted type.default booleanmatches(PojoTypeModel<?> typeToInspect) Attempts to match a given type against this pattern, and return the result as aboolean.Methods inherited from interface org.hibernate.search.mapper.pojo.model.typepattern.impl.TypePatternMatcher
and, negate
-
Method Details
-
matches
Description copied from interface:TypePatternMatcherAttempts to match a given type against this pattern, and return the result as aboolean.- Specified by:
matchesin interfaceTypePatternMatcher- Parameters:
typeToInspect- A type that may, or may not, match the pattern.- Returns:
truein the event of a match,falseotherwise.
-
extract
Attempts to match a given type against this pattern, and if matched, returns an upper bound of the extracted type.- Parameters:
typeToInspect- A type that may, or may not, match the pattern.- Returns:
- The extracted type if there was a match, or an empty
Optionalotherwise.
-