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_virtual_network_adapter")
public class HmdVirtualNetworkAdapter extends HmdGenericEntity {
    @Column("uuid")
    private String uuid; // 唯一标识
    @Column("target_id")
    private Long targetId; // 目标id，取值hmd_partition的id或hmd_profile的id
    @Column("target_type")
    private String targetType; // 目标类型，取值：partition或profile
    @Column("adapter_id")
    private Integer adapterId; // 适配器id
    @Column("type")
    private String type; // 类型，取值Trunk、Client
    @Column("virtual_network_id")
    private Long virtualNetworkId; // 虚拟网络id，取值hmd_virtual_network的id
    @Column("virtual_switch_id")
    private Long virtualSwitchId; // 虚拟交换机id，取值hmd_virtual_switch的id
    @Column("is_required")
    private Boolean isRequired; // 要激活分区，此适配器时必须的
    @Column("is_varied")
    private Boolean isVaried; // 多种多样的
    @Column("is_tagged_vlan_supported")
    private Boolean isTaggedVlanSupported; // 支持IEEE802.1兼容适配器
    @Column("tagged_vlan_ids")
    private String taggedVlanIds; // 兼容的vlanId列表
    @Column("vlan_id")
    private Integer vlanId; // vlanId
    @Column("priority")
    private Integer priority; // 优先级
    @Column("mac_address")
    private String macAddress; // mac地址
    @Column("location_code")
    private String locationCode; // 物理位置码

    private HmdPartition partition; // 所属的lpar/vios
    private HmdProfile profile; // 所属的概要文件
    private HmdServerVirtualSwitch virtualSwitch; // 使用的虚拟交换机
    private HmdServerVirtualNetwork virtualNetwork; // 使用的虚拟网络

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public Long getTargetId() {
        return targetId;
    }

    public void setTargetId(Long targetId) {
        this.targetId = targetId;
    }

    public String getTargetType() {
        return targetType;
    }

    public void setTargetType(String targetType) {
        this.targetType = targetType;
    }

    public Integer getAdapterId() {
        return adapterId;
    }

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

    public Long getVirtualNetworkId() {
        return virtualNetworkId;
    }

    public void setVirtualNetworkId(Long virtualNetworkId) {
        this.virtualNetworkId = virtualNetworkId;
    }

    public Boolean getIsRequired() {
        return isRequired;
    }

    public void setIsRequired(Boolean isRequired) {
        this.isRequired = isRequired;
    }

    public Boolean getIsTaggedVlanSupported() {
        return isTaggedVlanSupported;
    }

    public void setIsTaggedVlanSupported(Boolean isTaggedVlanSupported) {
        this.isTaggedVlanSupported = isTaggedVlanSupported;
    }

    public String getTaggedVlanIds() {
        return taggedVlanIds;
    }

    public void setTaggedVlanIds(String taggedVlanIds) {
        this.taggedVlanIds = taggedVlanIds;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    public String getMacAddress() {
        return macAddress;
    }

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

    public String getLocationCode() {
        return locationCode;
    }

    public void setLocationCode(String locationCode) {
        this.locationCode = locationCode;
    }

    public Boolean getIsVaried() {
        return isVaried;
    }

    public void setIsVaried(Boolean isVaried) {
        this.isVaried = isVaried;
    }

    public HmdServerVirtualSwitch getVirtualSwitch() {
        return virtualSwitch;
    }

    public HmdServerVirtualSwitch newVirtualSwitch() {
        this.virtualSwitch = new HmdServerVirtualSwitch();
        return virtualSwitch;
    }

    public void setVirtualSwitch(HmdServerVirtualSwitch virtualSwitch) {
        this.virtualSwitch = virtualSwitch;
    }

    public HmdServerVirtualNetwork getVirtualNetwork() {
        return virtualNetwork;
    }

    public HmdServerVirtualNetwork newVirtualNetwork() {
        this.virtualNetwork = new HmdServerVirtualNetwork();
        return virtualNetwork;
    }

    public void setVirtualNetwork(HmdServerVirtualNetwork virtualNetwork) {
        this.virtualNetwork = virtualNetwork;
    }

    public Long getVirtualSwitchId() {
        return virtualSwitchId;
    }

    public void setVirtualSwitchId(Long virtualSwitchId) {
        this.virtualSwitchId = virtualSwitchId;
    }

    public Integer getVlanId() {
        return vlanId;
    }

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

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public HmdPartition getPartition() {
        return partition;
    }

    public HmdPartition newPartition() {
        this.partition = new HmdPartition();
        return partition;
    }

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

    public HmdProfile getProfile() {
        return profile;
    }

    public void setProfile(HmdProfile profile) {
        this.profile = profile;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        HmdVirtualNetworkAdapter that = (HmdVirtualNetworkAdapter) o;
        return Objects.equals(targetId, that.targetId) &&
                Objects.equals(targetType, that.targetType) &&
                Objects.equals(adapterId, that.adapterId);
    }

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

