package com.bocloud.ims.entity.resource.hmc;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.Table;

import java.util.Objects;

@Table("hmd_server_io_adapter")
public class HmdServerIoAdapter extends HmdGenericEntity {
    @Column("server_id")
    private Long serverId; // 所属服务器id，对应hmd_server表的id字段
    @Column("adapter_id")
    private Integer adapterId; // 适配器id
    @Column("device_name")
    private String deviceName; // 设备名称
    @Column("description")
    private String description; // 描述
    @Column("io_bus_id")
    private Integer ioBusId; // io_bus id

    private HmdServer server; // 所属服务器

    public Long getServerId() {
        return serverId;
    }

    public void setServerId(Long serverId) {
        this.serverId = serverId;
    }

    public Integer getAdapterId() {
        return adapterId;
    }

    public void setAdapterId(Integer adapterId) {
        this.adapterId = adapterId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getIoBusId() {
        return ioBusId;
    }

    public void setIoBusId(Integer ioBusId) {
        this.ioBusId = ioBusId;
    }

    public HmdServer getServer() {
        return server;
    }

    public void setServer(HmdServer server) {
        this.server = server;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        HmdServerIoAdapter ioAdapter = (HmdServerIoAdapter) o;
        return Objects.equals(serverId, ioAdapter.serverId) &&
                Objects.equals(adapterId, ioAdapter.adapterId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(serverId, adapterId);
    }
}

