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

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

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

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

    private String diskPath;
    private String mountedOn;
    private String fsType;
    private long size;
    private long used;
    private long avail;
    private int inodeTotal;
    private int inodeFree;

    public DiskInfo(Disk.DiskDetail diskDetail) {
        this.diskPath = diskDetail.getDiskPath();
        this.mountedOn = diskDetail.getMountedOn();
        this.fsType = diskDetail.getFsType();
        this.size = diskDetail.getSize();
        this.used = diskDetail.getUsed();
        this.avail = diskDetail.getAvail();
        this.inodeTotal = diskDetail.getInodeTotal();
        this.inodeFree = diskDetail.getInodeFree();
    }
}
