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_vios_sea")
public class HmdViosSea extends HmdGenericEntity {
    @Column("vios_id")
    private Long viosId; // 所属vios的id，对应hmd_partition表的id字段
    @Column("physical_ethernet_adapter_id")
    private Long physicalEthernetAdapterId; // 物理以太网适配器id，对应表hmd_physical_ethernet_adapter的id字段
    @Column("partition_network_adapter_id")
    private Long partitionNetworkAdapterId; // 虚拟以太网适配器id，对应表hmd_partition_network_adapter的id字段
    @Column("vlan_id")
    private Integer vlanId; // vlanId
    @Column("ip_interface_name")
    private String ipInterfaceName; // 网络接口名称
    @Column("ip_interface_status")
    private String ipInterfaceStatus; // 网络接口状态
    @Column("ip_address")
    private String ipAddress; // IP地址
    @Column("subnet_mask")
    private String subnetMask; // 子网掩码
    @Column("unique_device_id")
    private String uniqueDeviceId; // 设备唯一id
    @Column("name")
    private String name; // 名称

    private HmdPartition vios; // 所属vios
    private HmdViosPhysicalEthernetAdapter physicalEthernetAdapter; // 使用的物理网卡
    private HmdVirtualNetworkAdapter virtualNetworkAdapter; // 使用的虚拟网卡

    public Long getViosId() {
        return viosId;
    }

    public void setViosId(Long viosId) {
        this.viosId = viosId;
    }

    public Long getPhysicalEthernetAdapterId() {
        return physicalEthernetAdapterId;
    }

    public void setPhysicalEthernetAdapterId(Long physicalEthernetAdapterId) {
        this.physicalEthernetAdapterId = physicalEthernetAdapterId;
    }

    public Long getPartitionNetworkAdapterId() {
        return partitionNetworkAdapterId;
    }

    public void setPartitionNetworkAdapterId(Long partitionNetworkAdapterId) {
        this.partitionNetworkAdapterId = partitionNetworkAdapterId;
    }

    public Integer getVlanId() {
        return vlanId;
    }

    public void setVlanId(Integer vlanId) {
        this.vlanId = vlanId;
    }

    public String getIpInterfaceName() {
        return ipInterfaceName;
    }

    public void setIpInterfaceName(String ipInterfaceName) {
        this.ipInterfaceName = ipInterfaceName;
    }

    public String getIpInterfaceStatus() {
        return ipInterfaceStatus;
    }

    public void setIpInterfaceStatus(String ipInterfaceStatus) {
        this.ipInterfaceStatus = ipInterfaceStatus;
    }

    public String getIpAddress() {
        return ipAddress;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public String getSubnetMask() {
        return subnetMask;
    }

    public void setSubnetMask(String subnetMask) {
        this.subnetMask = subnetMask;
    }

    public String getUniqueDeviceId() {
        return uniqueDeviceId;
    }

    public void setUniqueDeviceId(String uniqueDeviceId) {
        this.uniqueDeviceId = uniqueDeviceId;
    }

    public String getName() {
        return name;
    }

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

    public HmdPartition getVios() {
        return vios;
    }

    public void setVios(HmdPartition vios) {
        this.vios = vios;
    }

    public HmdViosPhysicalEthernetAdapter getPhysicalEthernetAdapter() {
        return physicalEthernetAdapter;
    }

    public HmdViosPhysicalEthernetAdapter newPhysicalEthernetAdapter() {
        this.physicalEthernetAdapter = new HmdViosPhysicalEthernetAdapter();
        return physicalEthernetAdapter;
    }

    public void setPhysicalEthernetAdapter(HmdViosPhysicalEthernetAdapter physicalEthernetAdapter) {
        this.physicalEthernetAdapter = physicalEthernetAdapter;
    }

    public HmdVirtualNetworkAdapter getVirtualNetworkAdapter() {
        return virtualNetworkAdapter;
    }

    public HmdVirtualNetworkAdapter newVirtualNetworkAdapter() {
        this.virtualNetworkAdapter = new HmdVirtualNetworkAdapter();
        return virtualNetworkAdapter;
    }

    public void setVirtualNetworkAdapter(HmdVirtualNetworkAdapter virtualNetworkAdapter) {
        this.virtualNetworkAdapter = virtualNetworkAdapter;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        HmdViosSea that = (HmdViosSea) o;
        return Objects.equals(viosId, that.viosId) &&
                Objects.equals(name, that.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(viosId, name);
    }
}

