public < X extends Throwable > V getValueOrElseThrow ( Supplier < ? extends X > exceptionSupplier ) throws X { LettuceAssert . notNull ( exceptionSupplier , "Supplier function must not be null" ) ; if ( hasValue ( ) ) { return value ; } throw exceptionSupplier . get ( ) ; }
Return the contained value if present otherwise throw an exception to be created by the provided supplier .