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.

    • 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