package cn.reghao.autodop.dmaster.machine.model.po;

import cn.reghao.jdkutil.machine.Network;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Embeddable;
import java.io.Serializable;

/**
 * @author reghao
 * @date 2021-10-15 15:49:43
 */
@NoArgsConstructor
@Embeddable
@Data
public class NetworkInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    private String iface;
    private String mac;
    private String ipv4;
    private String ipv6;

    public NetworkInfo(Network.NetworkDetail networkDetail) {
        this.iface = networkDetail.getIface();
        this.mac = networkDetail.getMac();
        this.ipv4 = networkDetail.getIpv4();
        this.ipv6 = networkDetail.getIpv6();
    }
}
