Interface ExtractingTypePatternMatcher
-
- All Superinterfaces:
TypePatternMatcher
public interface ExtractingTypePatternMatcher extends 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 againstCollectionand its subclasses, and would extract the resolved type for parameterTin the event of a match.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<? 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 Detail
-
matches
default boolean matches(PojoTypeModel<?> typeToInspect)
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
Optional<? 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.- 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.
-
-