Class RowBuilder

java.lang.Object
io.github.coho04.mysql.entities.RowBuilder

public class RowBuilder extends Object
The RowBuilder class is used to build a row for database insertion. It allows users to insert key-value pairs into a HashMap using the with() method, and retrieve the built HashMap using the build() method.
  • Constructor Details

    • RowBuilder

      public RowBuilder()
  • Method Details

    • with

      public RowBuilder with(Column column, Object item)
      Inserts a key-value pair into the insertMap HashMap. The key is the name of the given column, and the value is converted to a String using String.valueOf().
      Parameters:
      column - The Column object representing the column in the database table.
      item - The value to be inserted into the column.
      Returns:
      The updated RowBuilder object.
    • build

      public HashMap<String,String> build()
      Builds and returns a HashMap containing the key-value pairs that were inserted using the with() method.
      Returns:
      A HashMap containing the key-value pairs.