Package org.jdbi.v3.core.statement
Class StatementExceptions
- java.lang.Object
-
- org.jdbi.v3.core.statement.StatementExceptions
-
- All Implemented Interfaces:
JdbiConfig<StatementExceptions>
@Beta public class StatementExceptions extends java.lang.Object implements JdbiConfig<StatementExceptions>
Configuration forStatementExceptionand subclasses behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classStatementExceptions.MessageRenderingControl exception message generation.
-
Field Summary
Fields Modifier and Type Field Description private intlengthLimitprivate java.util.function.Function<StatementException,java.lang.String>messageRendering
-
Constructor Summary
Constructors Modifier Constructor Description StatementExceptions()privateStatementExceptions(StatementExceptions other)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StatementExceptionscreateCopy()Returns a copy of this configuration object.intgetLengthLimit()Returns the limit hint to use to shorten strings.java.util.function.Function<StatementException,java.lang.String>getMessageRendering()Returns the statement exception message rendering strategy.protected static java.lang.Stringlimit(java.lang.String s, int len)StatementExceptionssetLengthLimit(int lengthLimit)Set a hint on how long you'd like to shorten various variable-length strings to.StatementExceptionssetMessageRendering(java.util.function.Function<StatementException,java.lang.String> messageRendering)Configure exception statement message generation.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.JdbiConfig
setRegistry
-
-
-
-
Field Detail
-
messageRendering
private java.util.function.Function<StatementException,java.lang.String> messageRendering
-
lengthLimit
private int lengthLimit
-
-
Constructor Detail
-
StatementExceptions
public StatementExceptions()
-
StatementExceptions
private StatementExceptions(StatementExceptions other)
-
-
Method Detail
-
getLengthLimit
public int getLengthLimit()
Returns the limit hint to use to shorten strings.- Returns:
- the limit hint to use to shorten strings.
-
setLengthLimit
public StatementExceptions setLengthLimit(int lengthLimit)
Set a hint on how long you'd like to shorten various variable-length strings to.- Parameters:
lengthLimit- the limit hint.- Returns:
- this
-
getMessageRendering
public java.util.function.Function<StatementException,java.lang.String> getMessageRendering()
Returns the statement exception message rendering strategy.- Returns:
- the statement exception message rendering strategy.
- See Also:
StatementExceptions.MessageRendering
-
setMessageRendering
public StatementExceptions setMessageRendering(java.util.function.Function<StatementException,java.lang.String> messageRendering)
Configure exception statement message generation.- Parameters:
messageRendering- the message rendering strategy to use- Returns:
- this
- See Also:
StatementExceptions.MessageRendering
-
createCopy
public StatementExceptions createCopy()
Description copied from interface:JdbiConfigReturns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopyin interfaceJdbiConfig<StatementExceptions>- Returns:
- a copy of this configuration object.
-
limit
protected static java.lang.String limit(java.lang.String s, int len)
-
-