package vn.azteam.tpf.service.dto;

import java.time.Instant;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * A DTO for the TBPermission entity.
 */
public class TBPermissionDTO implements Serializable {

    private Long id;

    private String name;

    private Integer hasPermission;

    private Instant createdDate;

    private Instant modifiedDate;

    private Instant deletedDate;

    private Long tbFunctionId;

    private Long tbRoleId;

    private Long createdById;

    private Long modifiedById;

    private Long deletedById;

    private List<CasbinDTO> casbinDTOList;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getHasPermission() {
        return hasPermission;
    }

    public void setHasPermission(Integer hasPermission) {
        this.hasPermission = hasPermission;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public Instant getModifiedDate() {
        return modifiedDate;
    }

    public void setModifiedDate(Instant modifiedDate) {
        this.modifiedDate = modifiedDate;
    }

    public Instant getDeletedDate() {
        return deletedDate;
    }

    public void setDeletedDate(Instant deletedDate) {
        this.deletedDate = deletedDate;
    }

    public Long getTbFunctionId() {
        return tbFunctionId;
    }

    public void setTbFunctionId(Long tBFunctionId) {
        this.tbFunctionId = tBFunctionId;
    }

    public Long getTbRoleId() {
        return tbRoleId;
    }

    public void setTbRoleId(Long tBRoleId) {
        this.tbRoleId = tBRoleId;
    }

    public Long getCreatedById() {
        return createdById;
    }

    public void setCreatedById(Long tBDetailUserId) {
        this.createdById = tBDetailUserId;
    }

    public Long getModifiedById() {
        return modifiedById;
    }

    public void setModifiedById(Long tBDetailUserId) {
        this.modifiedById = tBDetailUserId;
    }

    public Long getDeletedById() {
        return deletedById;
    }

    public void setDeletedById(Long tBDetailUserId) {
        this.deletedById = tBDetailUserId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<CasbinDTO> getCasbinDTOList() {
        return casbinDTOList;
    }

    public void setCasbinDTOList(List<CasbinDTO> casbinDTOList) {
        this.casbinDTOList = casbinDTOList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TBPermissionDTO tBPermissionDTO = (TBPermissionDTO) o;
        if (tBPermissionDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), tBPermissionDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "TBPermissionDTO{" +
            "id=" + getId() +
            ", hasPermission=" + getHasPermission() +
            ", createdDate='" + getCreatedDate() + "'" +
            ", modifiedDate='" + getModifiedDate() + "'" +
            ", deletedDate='" + getDeletedDate() + "'" +
            ", tbFunction=" + getTbFunctionId() +
            ", tbRole=" + getTbRoleId() +
            ", createdBy=" + getCreatedById() +
            ", modifiedBy=" + getModifiedById() +
            ", deletedBy=" + getDeletedById() +
            "}";
    }
}
