Class TableDTO.Builder<S extends TableDTO.Builder>

java.lang.Object
org.apache.gravitino.dto.rel.TableDTO.Builder<S>
Type Parameters:
S - The type of the builder subclass.
Enclosing class:
TableDTO

public static class TableDTO.Builder<S extends TableDTO.Builder> extends Object
Builder class for constructing TableDTO instances.
  • Field Details

    • name

      protected String name
      The name of the table.
    • comment

      protected String comment
      The comment associated with the table.
    • columns

      protected ColumnDTO[] columns
      The columns of the table.
    • properties

      protected Map<String,String> properties
      The properties associated with the table.
    • audit

      protected AuditDTO audit
      The audit information for the table.
    • sortOrderDTOs

      protected SortOrderDTO[] sortOrderDTOs
      The distribution of the table.
    • distributionDTO

      protected DistributionDTO distributionDTO
      The distribution of the table.
    • Partitioning

      protected Partitioning[] Partitioning
      The partitioning of the table.
    • indexes

      protected IndexDTO[] indexes
      The indexes of the table.
  • Method Details

    • withName

      public S withName(String name)
      Sets the name of the table.
      Parameters:
      name - The name of the table.
      Returns:
      The Builder instance.
    • withComment

      public S withComment(String comment)
      Sets the comment associated with the table.
      Parameters:
      comment - The comment associated with the table.
      Returns:
      The Builder instance.
    • withColumns

      public S withColumns(ColumnDTO[] columns)
      Sets the columns of the table.
      Parameters:
      columns - The columns of the table.
      Returns:
      The Builder instance.
    • withProperties

      public S withProperties(Map<String,String> properties)
      Sets the properties associated with the table.
      Parameters:
      properties - The properties associated with the table.
      Returns:
      The Builder instance.
    • withAudit

      public S withAudit(AuditDTO audit)
      Sets the audit information for the table.
      Parameters:
      audit - The audit information for the table.
      Returns:
      The Builder instance.
    • withDistribution

      public S withDistribution(DistributionDTO distributionDTO)
      Sets the distribution of the table.
      Parameters:
      distributionDTO - The distribution of the table.
      Returns:
      The Builder instance.
    • withSortOrders

      public S withSortOrders(SortOrderDTO[] sortOrderDTOs)
      Sets the sort orders of the table.
      Parameters:
      sortOrderDTOs - The sort orders of the table.
      Returns:
      The Builder instance.
    • withPartitioning

      public S withPartitioning(Partitioning[] Partitioning)
      Sets the partitioning of the table.
      Parameters:
      Partitioning - The partitioning of the table.
      Returns:
      The Builder instance.
    • withIndex

      public S withIndex(IndexDTO[] indexes)
      Sets the indexes of the table.
      Parameters:
      indexes - The indexes of the table.
      Returns:
      The Builder instance.
    • build

      public TableDTO build()
      Builds a Table DTO based on the provided builder parameters.
      Returns:
      A new TableDTO instance.
      Throws:
      IllegalArgumentException - If required fields name, columns and audit are not set.
    • builder

      public static TableDTO.Builder builder()
      Creates a new instance of TableDTO.Builder.
      Returns:
      The new instance.