Package com.pyranid

Class StatementLog.Builder<T>

java.lang.Object
com.pyranid.StatementLog.Builder<T>
Enclosing class:
StatementLog<T>

@NotThreadSafe public static class StatementLog.Builder<T> extends Object
Builder used to construct instances of StatementLog.

This class is intended for use by a single thread.

Since:
1.0.0
Author:
Mark Allen
  • Method Details

    • connectionAcquisitionDuration

      @Nonnull public StatementLog.Builder connectionAcquisitionDuration(@Nullable Duration connectionAcquisitionDuration)
      Specifies how long it took to acquire a Connection from the DataSource.
      Parameters:
      connectionAcquisitionDuration - how long it took to acquire a Connection, if available
      Returns:
      this Builder, for chaining
    • preparationDuration

      public StatementLog.Builder preparationDuration(@Nullable Duration preparationDuration)
      Specifies how long it took to bind data to a PreparedStatement.
      Parameters:
      preparationDuration - how long it took to bind data to a PreparedStatement, if available
      Returns:
      this Builder, for chaining
    • executionDuration

      public StatementLog.Builder executionDuration(@Nullable Duration executionDuration)
      Specifies how long it took to execute a SQL statement.
      Parameters:
      executionDuration - how long it took to execute a SQL statement, if available
      Returns:
      this Builder, for chaining
    • resultSetMappingDuration

      public StatementLog.Builder resultSetMappingDuration(@Nullable Duration resultSetMappingDuration)
      Specifies how long it took to extract data from a ResultSet.
      Parameters:
      resultSetMappingDuration - how long it took to extract data from a ResultSet, if available
      Returns:
      this Builder, for chaining
    • batchSize

      public StatementLog.Builder batchSize(@Nullable Integer batchSize)
      Specifies the size of the batch operation.
      Parameters:
      batchSize - how many records were processed as part of the batch operation, if available
      Returns:
      this Builder, for chaining
    • exception

      public StatementLog.Builder exception(@Nullable Exception exception)
      Specifies the exception that occurred during SQL statement execution.
      Parameters:
      exception - the exception that occurred during SQL statement execution, if available
      Returns:
      this Builder, for chaining
    • build

      @Nonnull public StatementLog build()
      Constructs a StatementLog instance.
      Returns:
      a StatementLog instance