private Graph < String > gengraph ( Configuration cf ) { Graph . Builder < String > builder = new Graph . Builder <> ( ) ; cf . modules ( ) . stream ( ) . forEach ( rm -> { String mn = rm . name ( ) ; builder . addNode ( mn ) ; rm . reads ( ) . stream ( ) . map ( ResolvedModule :: name ) . forEach ( target -> builder . addEdge ( mn , target ) ) ; } ) ; Graph < String > rpg = requiresTransitiveGraph ( cf , builder . nodes ) ; return builder . build ( ) . reduce ( rpg ) ; }
Returns a Graph of the given Configuration after transitive reduction .