I'd like to use
java.util.Optional.orElseThrow()
with an Exception type that asks for a constructor parameter. Something like this:
.orElseThrow(MyException::new(someArgument)) // obviously NOT working
Is there a way to create a Supplier that passes my argument value in?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…