package cn.reghao.bnt.common.machine;

import cn.reghao.jutil.jdk.converter.ByteConverter;
import cn.reghao.jutil.jdk.machine.data.MachineData;
import cn.reghao.jutil.jdk.machine.data.detail.OsDetail;
import cn.reghao.jutil.jdk.machine.data.stat.OsStat;
import oshi.SystemInfo;
import oshi.hardware.HardwareAbstractionLayer;
import oshi.software.os.OperatingSystem;

/**
 * @author reghao
 * @date 2020-10-20 23:17:30
 */
public class OS implements MachineData<OsDetail, OsStat> {
    private final HardwareAbstractionLayer hal;
    private OperatingSystem os;
    private final ByteConverter byteConverter;

    public OS(SystemInfo si, ByteConverter byteConverter) {
        this.hal = si.getHardware();
        this.os = si.getOperatingSystem();
        this.byteConverter = byteConverter;
    }

    @Override
    public OsDetail detail() {
        OsDetail osDetail = new OsDetail();
        osDetail.setBootTime(os.getSystemBootTime());
        return osDetail;
    }

    @Override
    public OsStat stat() {
        return null;
    }

    public void getOSInfo() {
    }
}
