Package io.github.coho04.mysql.entities
Class RowBuilder
java.lang.Object
io.github.coho04.mysql.entities.RowBuilder
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 Summary
-
Method Summary
-
Constructor Details
-
RowBuilder
public RowBuilder()
-
-
Method Details
-
with
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
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.
-