package com.ecep.contract.controller.table.cell;

import static com.ecep.contract.SpringApp.getBean;

import com.ecep.contract.model.Employee;
import com.ecep.contract.service.EmployeeService;
import com.ecep.contract.service.ViewModelService;

import lombok.Setter;

@Setter
public class EmployeeTableCell<V> extends AsyncUpdateTableCell<V, Employee> {

    public EmployeeTableCell() {
    }

    public EmployeeTableCell(EmployeeService employeeService) {
        setService(employeeService);
    }

    @Override
    protected ViewModelService<Employee, ?> getServiceBean() {
        return getBean(EmployeeService.class);
    }

    @Override
    public String format(Employee entity) {
        return entity.toPrettyString();
    }

}
