public static Optional < TrackInfo > getTrackInfo ( EventModel eventModel ) { if ( eventModel . getListResourceContainer ( ) . containsResourcesFromSource ( RESOURCE_ID ) ) { return eventModel . getListResourceContainer ( ) . provideResource ( RESOURCE_ID ) . stream ( ) . findAny ( ) . flatMap ( TrackInfo :: importFromResource ) ; } else { return Optional . empty ( ) ; } }
gets the first TrackInfo if found in the EventModel