Module org.firebirdsql.jaybird
Package org.firebirdsql.jaybird.util
Interface SQLExceptionThrowingFunction<T,R>
- Type Parameters:
T
- type of the input to the functionR
- type of the result of the function
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Function that can throw a
SQLException
.- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionConverts this instance to a normalFunction
, throwingUncheckedSQLException
instead ofSQLException
.static <T,
R> Function<T, R> Convenience method to convert aSQLExceptionThrowingFunction
to aFunction
.static <T,
R> SQLExceptionThrowingFunction<T, R> Converts a normalFunction
to aSQLExceptionThrowingFunction
, unwrapping anyUncheckedSQLException
thrown toSQLException
.
-
Method Details
-
apply
- Throws:
SQLException
-
toFunction
Converts this instance to a normalFunction
, throwingUncheckedSQLException
instead ofSQLException
.- Returns:
- normal
Function
instance throwingUncheckedSQLException
- See Also:
-
toFunction
Convenience method to convert aSQLExceptionThrowingFunction
to aFunction
.Equivalent to
f.toFunction()
, but can be used for call-site type inference.- Type Parameters:
T
- type of the input to the functionR
- type of the result of the function- Parameters:
f
- function to convert- Returns:
- normal
Function
instance throwingUncheckedSQLException
- See Also:
-
toSQLExceptionThrowingFunction
Converts a normalFunction
to aSQLExceptionThrowingFunction
, unwrapping anyUncheckedSQLException
thrown toSQLException
.- Type Parameters:
T
- type of the input to the functionR
- type of the result of the function- Parameters:
f
- function to convert- Returns:
SQLExceptionThrowingFunction
instance- See Also:
-