package com.ecep.contract.model;

import java.io.Serializable;
import java.util.Objects;

import com.ecep.contract.VendorFileType;
import com.ecep.contract.util.HibernateProxyUtils;
import com.ecep.contract.vo.VendorFileTypeLocalVo;

import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 供应商文件类型（多国语言支持）
 */
@Getter
@Setter
@Entity
@Table(name = "COMPANY_VENDOR_FILE_TYPE_LOCAL")
@ToString
public class VendorFileTypeLocal extends BaseEnumEntity<VendorFileType> implements Serializable, Voable<VendorFileTypeLocalVo> {
    private static final long serialVersionUID = 1L;

    @Override
    public final boolean equals(Object object) {
        if (this == object)
            return true;
        if (object == null)
            return false;
        if (HibernateProxyUtils.isNotEffectiveClassEquals(object, this)) {
            return false;
        }
        VendorFileTypeLocal that = (VendorFileTypeLocal) object;
        return getId() != null && Objects.equals(getId(), that.getId());
    }

    @Override
    public final int hashCode() {
        return HibernateProxyUtils.hashCode(this);
    }

    @Override
    public VendorFileTypeLocalVo toVo() {
        VendorFileTypeLocalVo vo = new VendorFileTypeLocalVo();
        vo.setId(getId());
        vo.setLang(getLang());
        vo.setValue(getValue());
        vo.setType(getType());
        return vo;
    }
}
