public < T , X > List < CompletableFuture < X > > generateAllOutputExtensions ( OutputPluginModel < T , X > outputPlugin , T t , EventModel event ) { IdentifiableSet < OutputExtensionModel < ? , ? > > extensions = outputExtensions . get ( outputPlugin . getID ( ) ) ; if ( extensions == null ) return new ArrayList <> ( ) ; return filterType ( extensions , outputPlugin ) . stream ( ) . map ( extension -> { try { //noinspection unchecked return ( OutputExtensionModel < X , T > ) extension ; } catch ( ClassCastException e ) { return null ; } } ) . filter ( Objects :: nonNull ) . filter ( outputExtension -> outputExtension . canRun ( event ) ) . map ( extension -> submit ( ( ) -> extension . generate ( event , t ) ) ) . collect ( Collectors . toList ( ) ) ; }
Starts every associated OutputExtension