public List < ResourceModel > generateResources ( EventModel < ? > event ) { if ( ! event . getAllInformations ( ) . stream ( ) . anyMatch ( eventSubscribers :: containsKey ) ) return new LinkedList <> ( ) ; List < ResourceBuilderModel > resourceBuilders = event . getAllInformations ( ) . stream ( ) . map ( eventSubscribers :: get ) . filter ( Objects :: nonNull ) . flatMap ( Collection :: stream ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; return generateResources ( resourceBuilders , event ) ; }
generates all the resources for an event