Ref: Use Lombok annot's to minimize code.

This commit is contained in:
DaCool
2023-10-16 18:05:29 +00:00
committed by Sheepit Renderfarm
parent e0991622bf
commit dd0d50582f
4 changed files with 9 additions and 39 deletions

View File

@@ -22,12 +22,14 @@ package com.sheepit.client.hardware.cpu;
import com.sheepit.client.Log;
import com.sheepit.client.os.OS;
import com.sheepit.client.os.Windows;
import lombok.Getter;
import lombok.Setter;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CPU {
@Getter @Setter public class CPU {
public static final int MIN_CORES = Runtime.getRuntime().availableProcessors() > 1 ? 2 : 1;
private String name;
private String model;
@@ -43,22 +45,6 @@ public class CPU {
this.generateArch();
}
public String name() {
return this.name;
}
public String model() {
return this.model;
}
public String family() {
return this.family;
}
public String arch() {
return this.arch;
}
public int cores() {
// If logicalCores is -1, then haven't run the core-checking script yet
// Only want to run it once since cores is called multiple times
@@ -113,22 +99,6 @@ public class CPU {
return logicalCores;
}
public void setName(String name_) {
this.name = name_;
}
public void setModel(String model_) {
this.model = model_;
}
public void setFamily(String family_) {
this.family = family_;
}
public void setArch(String arch_) {
this.arch = arch_;
}
public void generateArch() {
String arch = System.getProperty("os.arch").toLowerCase();
switch (arch) {