Class MacAddressGenerator

java.lang.Object
io.bloviate.gen.AbstractDataGenerator<String>
io.bloviate.gen.MacAddressGenerator
All Implemented Interfaces:
DataGenerator<String>

public class MacAddressGenerator extends AbstractDataGenerator<String>
Generates MAC addresses as colon-separated hex octets, e.g. 08:00:2b:01:02:03.

Defaults to six octets (PostgreSQL macaddr); set MacAddressGenerator.Builder.octets(int) to 8 for the EUI-64 macaddr8 form.

  • 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
    • generateAsString

      public String generateAsString()
      Description copied from interface: DataGenerator
      Generates a value and returns its string representation.
      Specified by:
      generateAsString in interface DataGenerator<String>
      Overrides:
      generateAsString in class AbstractDataGenerator<String>
      Returns:
      the string representation of a generated value
    • 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