public static class StatementFormatter.Builder extends Object
StatementFormatter instances with a fluent API.| Modifier and Type | Method and Description |
|---|---|
StatementFormatter.Builder |
addStatementPrinters(StatementPrinter<?>... printers)
Adds the given
StatementPrinters to the list of available statement printers. |
StatementFormatter |
build()
Builds the
StatementFormatter instance. |
StatementFormatter.Builder |
withMaxBoundValueLength(int maxBoundValueLength)
Sets the maximum length, in numbers of printed characters, allowed for a single bound value.
|
StatementFormatter.Builder |
withMaxBoundValues(int maxBoundValues)
Sets the maximum number of printed bound values.
|
StatementFormatter.Builder |
withMaxInnerStatements(int maxInnerStatements)
Sets the maximum number of printed inner statements of a
BatchStatement. |
StatementFormatter.Builder |
withMaxQueryStringLength(int maxQueryStringLength)
Sets the maximum length allowed for query strings.
|
public StatementFormatter.Builder addStatementPrinters(StatementPrinter<?>... printers)
StatementPrinters to the list of available statement printers.
Note that built-in printers are always registered by default and they handle all the
driver built-in Statement subclasses. Calling this method is only useful if you need
to handle a special subclass of Statement; otherwise, the built-in printers should be
enough.
printers - The StatementPrinters to add.public StatementFormatter.Builder withMaxQueryStringLength(int maxQueryStringLength)
If the query string length exceeds this threshold, printers should truncate it.
maxQueryStringLength - the maximum length allowed for query strings.IllegalArgumentException - if the value is not > 0, or (unlimited).public StatementFormatter.Builder withMaxBoundValueLength(int maxBoundValueLength)
If the bound value length exceeds this threshold, printers should truncate it.
maxBoundValueLength - the maximum length, in numbers of printed characters, allowed for
a single bound value.IllegalArgumentException - if the value is not > 0, or (unlimited).public StatementFormatter.Builder withMaxBoundValues(int maxBoundValues)
If the number of bound values exceeds this threshold, printers should truncate it.
maxBoundValues - the maximum number of printed bound values.IllegalArgumentException - if the value is not > 0, or (unlimited).public StatementFormatter.Builder withMaxInnerStatements(int maxInnerStatements)
BatchStatement. The default
is . Setting this value to zero should disable the
printing of inner statements.
If the number of inner statements exceeds this threshold, printers should truncate it.
If the statement to format is not a batch statement, then this withting should be ignored.
maxInnerStatements - the maximum number of printed inner statements of a BatchStatement.IllegalArgumentException - if the value is not >= 0, or (unlimited).public StatementFormatter build()
StatementFormatter instance.StatementFormatter instance.Copyright © 2017–2021 DataStax. All rights reserved.