# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
from .table_cell_merge_info import TableCellMergeInfo
from .text import Text


class TableCell(object):
    _types = {
        "row_index": int,
        "col_index": int,
        "merge_info": TableCellMergeInfo,
        "children": List[str],
        "text": Text,
    }

    def __init__(self, d=None):
        self.row_index: Optional[int] = None
        self.col_index: Optional[int] = None
        self.merge_info: Optional[TableCellMergeInfo] = None
        self.children: Optional[List[str]] = None
        self.text: Optional[Text] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "TableCellBuilder":
        return TableCellBuilder()


class TableCellBuilder(object):
    def __init__(self) -> None:
        self._table_cell = TableCell()

    def row_index(self, row_index: int) -> "TableCellBuilder":
        self._table_cell.row_index = row_index
        return self

    def col_index(self, col_index: int) -> "TableCellBuilder":
        self._table_cell.col_index = col_index
        return self

    def merge_info(self, merge_info: TableCellMergeInfo) -> "TableCellBuilder":
        self._table_cell.merge_info = merge_info
        return self

    def children(self, children: List[str]) -> "TableCellBuilder":
        self._table_cell.children = children
        return self

    def text(self, text: Text) -> "TableCellBuilder":
        self._table_cell.text = text
        return self

    def build(self) -> "TableCell":
        return self._table_cell
