< R > R withPrompting ( Supplier < R > action ) { if ( prompting ) { throw new IllegalArgumentException ( ) ; } prompting = true ; try { return action . get ( ) ; } finally { prompting = false ; } }
Enables prompting applies an action and disables prompting .