Class IntervalGenerator

All Implemented Interfaces:
DataGenerator<String>

public class IntervalGenerator extends AbstractDataGenerator<String>
Generates time spans as a String in PostgreSQL interval input form, years-months days hours:minutes:seconds, e.g. 3-7 14 21:45:09.

Each component is drawn from a fixed range: years 1..9, months 1..11, days 1..29, hours 1..23, minutes and seconds 1..59 (all inclusive). Output is seeded and therefore reproducible for a given random source.

  • Method Details

    • generate

      public String 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 String 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