Class BitGenerator

All Implemented Interfaces:
DataGenerator<Integer>

public class BitGenerator extends AbstractDataGenerator<Integer>
Generates a single bit as an Integer that is either 0 or 1, chosen uniformly using the seeded random source (so a given seed yields a reproducible sequence). Backed by an IntegerGenerator over the half-open range [0, 2). Suitable for BIT columns.
  • Method Details

    • generate

      public Integer generate()
      Description copied from interface: DataGenerator
      Generates a random value of type T.
      Returns:
      a generated value, may be null if the generator supports nullable columns
    • get

      public Integer get(ResultSet resultSet, int columnIndex) throws SQLException
      Description copied from interface: DataGenerator
      Retrieves a value from a ResultSet column.
      Parameters:
      resultSet - the result set to read from
      columnIndex - the 1-based column index
      Returns:
      the value from the result set, properly cast to type T
      Throws:
      SQLException - if the database operation fails