Class TableBuilder

java.lang.Object
com.illumon.iris.db.v2.utils.TableBuilder

public class TableBuilder
extends Object
Class to aid in building Tables from a TableDefinition.
  • Constructor Details

    • TableBuilder

      public TableBuilder​(@NotNull TableDefinition def)
      Creates a TableBuilder object based on a table Definition.
      Parameters:
      def - the definition of the table that you want to build
    • TableBuilder

      public TableBuilder​(@NotNull TableDefinition def, int initialCapacity)
  • Method Details

    • rowCount

      public long rowCount()
      returns the number of rows the table has
      Returns:
      the size of the row List
    • addRow

      public void addRow​(@NotNull Object... items)
      Adds a row to the table. Items will be inserted into the row the order they are put into this method
      Parameters:
      items - The items that will appear in the row. Must be the same amount of items as columns
    • build

      public Table build()
      Builds the table from the TableDefinition and the rows added. Calling this will reset the state of this builder as in clear().
      Returns:
      A new table containing the rows added via addRow(Object...)
    • clear

      public void clear()
      Deletes all rows from the TableBuilder.