Interface AbstractMockChecker.TypeExtractor<T extends Tree>
-
- Type Parameters:
T
- the type of Tree that this TypeExtractor operates on
- Enclosing class:
- AbstractMockChecker<T extends Annotation>
public static interface AbstractMockChecker.TypeExtractor<T extends Tree>
An extension ofMatcher
to return, not just a boolean `matches`, but also extract some type information about the Tree of interest.This is used to identify what classes are being mocked in a Tree.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<com.sun.tools.javac.code.Type>
extract(T tree, VisitorState state)
Investigate the provided Tree, and return type information about it if it matches.default AbstractMockChecker.TypeExtractor<T>
or(AbstractMockChecker.TypeExtractor<T> other)
Enrich this TypeExtractor with fallback behavior.
-
-
-
Method Detail
-
extract
Optional<com.sun.tools.javac.code.Type> extract(T tree, VisitorState state)
Investigate the provided Tree, and return type information about it if it matches.- Returns:
- the Type of the object being mocked, if any; Optional.empty() otherwise
-
or
default AbstractMockChecker.TypeExtractor<T> or(AbstractMockChecker.TypeExtractor<T> other)
Enrich this TypeExtractor with fallback behavior.- Returns:
- a TypeExtractor which first tries
this.extract(t, s)
, and if that does not match, falls back toother.extract(t, s)
.
-
-