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 of
Matcher 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.
- Author:
- amalloy@google.com (Alan Malloy)
-
Method Summary
Modifier and TypeMethodDescriptionOptional<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 Details
-
extract
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
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).
-