public static < T , R > Supplier < R > andThen ( Supplier < T > supplier , Function < T , R > resultHandler , Function < Exception , R > exceptionHandler ) { return ( ) -> { try { T result = supplier . get ( ) ; return resultHandler . apply ( result ) ; } catch ( Exception exception ) { return exceptionHandler . apply ( exception ) ; } } ; }
Returns a composed function that first applies the Supplier and then applies either the resultHandler or exceptionHandler .