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_hea_logical_port")
public class HmdServerHeaLogicalPort extends HmdGenericEntity {
    @Column("hea_id")
    private Long heaId; // 主机以太网适配器id，关联hmd_server_hea的id字段
    @Column("adapter_id")
    private Integer adapterId; // 适配器id
    @Column("logical_port_id")
    private Integer logicalPortId; // 端口id
    @Column("port_state")
    private String portState; // 端口状态
    @Column("mac_address")
    private String macAddress; // mac地址
    @Column("allowed_mac_addresses")
    private String allowedMacAddresses; // 允许的mac地址
    @Column("allowed_vlan_ids")
    private String allowedVlanIds; // 允许的vlanId
    @Column("partition_id")
    private Long partitionId; // 分配的逻辑分区id，对应hmd_partition表的id字段
    @Column("port_group_id")
    private Integer portGroupId; // 端口组id

    private HmdServerHea hea; // 所属hea
    private HmdPartition partition; // 分配的逻辑分区

    public Long getHeaId() {
        return heaId;
    }

    public void setHeaId(Long heaId) {
        this.heaId = heaId;
    }

    public Integer getAdapterId() {
        return adapterId;
    }

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

    public Integer getLogicalPortId() {
        return logicalPortId;
    }

    public void setLogicalPortId(Integer logicalPortId) {
        this.logicalPortId = logicalPortId;
    }

    public String getPortState() {
        return portState;
    }

    public void setPortState(String portState) {
        this.portState = portState;
    }

    public String getMacAddress() {
        return macAddress;
    }

    public void setMacAddress(String macAddress) {
        this.macAddress = macAddress;
    }

    public String getAllowedMacAddresses() {
        return allowedMacAddresses;
    }

    public void setAllowedMacAddresses(String allowedMacAddresses) {
        this.allowedMacAddresses = allowedMacAddresses;
    }

    public String getAllowedVlanIds() {
        return allowedVlanIds;
    }

    public void setAllowedVlanIds(String allowedVlanIds) {
        this.allowedVlanIds = allowedVlanIds;
    }

    public Long getPartitionId() {
        return partitionId;
    }

    public void setPartitionId(Long partitionId) {
        this.partitionId = partitionId;
    }

    public Integer getPortGroupId() {
        return portGroupId;
    }

    public void setPortGroupId(Integer portGroupId) {
        this.portGroupId = portGroupId;
    }

    public HmdServerHea getHea() {
        return hea;
    }

    public void setHea(HmdServerHea hea) {
        this.hea = hea;
    }

    public HmdPartition getPartition() {
        return partition;
    }

    public void setPartition(HmdPartition partition) {
        this.partition = partition;
    }

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

    @Override
    public int hashCode() {
        return Objects.hash(heaId, logicalPortId);
    }
}

