public List < Route > getBefore ( String path ) { String cleanPath = parsePath ( path ) ; List < Route > collect = hooks . values ( ) . stream ( ) . flatMap ( Collection :: stream ) . sorted ( Comparator . comparingInt ( Route :: getSort ) ) . filter ( route -> route . getHttpMethod ( ) == HttpMethod . BEFORE && matchesPath ( route . getPath ( ) , cleanPath ) ) . collect ( Collectors . toList ( ) ) ; this . giveMatch ( path , collect ) ; return collect ; }
Find all in before of the hook