use of oshi.hardware.ComputerSystem in project yyl_example by Relucent.
the class OshiExample method infoIdentifier.
public static void infoIdentifier(SystemInfo si) {
OperatingSystem operatingSystem = si.getOperatingSystem();
HardwareAbstractionLayer hardwareAbstractionLayer = si.getHardware();
CentralProcessor centralProcessor = hardwareAbstractionLayer.getProcessor();
ComputerSystem computerSystem = hardwareAbstractionLayer.getComputerSystem();
String vendor = operatingSystem.getManufacturer();
String processorSerialNumber = computerSystem.getSerialNumber();
String uuid = computerSystem.getHardwareUUID();
String processorIdentifier = centralProcessor.getProcessorIdentifier().getIdentifier();
int processors = centralProcessor.getLogicalProcessorCount();
println(//
String.format("%08x", vendor.hashCode()) + "-" + String.format("%08x", processorSerialNumber.hashCode()) + //
"-" + String.format("%08x", uuid.hashCode()) + //
"-" + String.format("%08x", processorIdentifier.hashCode()) + //
"-" + processors);
}
Aggregations