Package org.firebirdsql.util
Class SQLExceptionChainBuilder<E extends SQLException>
java.lang.Object
org.firebirdsql.util.SQLExceptionChainBuilder<E>
- Type Parameters:
E- Type of SQLException (definition: E extends SQLException)
Helper class for building
SQLException chains.
NOTE: This class is not thread-safe; an instance should only be used on a single thread or with proper external synchronisation.
- Since:
- 2.2
- Author:
- Mark Rotteveel
-
Constructor Summary
ConstructorsConstructorDescriptionCreate SQLExceptionChainBuilderSQLExceptionChainBuilder(E root) Create SQLExceptionChainBuilder with the specified root exception. -
Method Summary
Modifier and TypeMethodDescriptionAppends the passed SQLException to the exception chain.boolean
-
Constructor Details
-
SQLExceptionChainBuilder
public SQLExceptionChainBuilder()Create SQLExceptionChainBuilder -
SQLExceptionChainBuilder
Create SQLExceptionChainBuilder with the specified root exception.- Parameters:
root- Root SQLException
-
-
Method Details
-
append
Appends the passed SQLException to the exception chain.If this SQLExceptionChainBuilder does not have a root,
sqlewill be come the root.- Parameters:
sqle- SQLException to add to the chain.- Returns:
- this SQLExceptionChainBuilder
-
hasException
public boolean hasException()- Returns:
trueif this SQLExceptionChainBuilder contains at least one SQLException.
-
getException
- Returns:
- The root SQLException or
nullif no SQLException was added to this SQLExceptionChainBuilder
-