Use lombok annotation instead of get/set

This commit is contained in:
Laurent Clouet
2019-08-07 22:17:59 +02:00
parent 9b36dcf9b5
commit 9f1f509bb6
12 changed files with 123 additions and 420 deletions

View File

@@ -167,13 +167,13 @@ public class Worker {
System.err.println("GPU unknown, list of available gpus can be display with --show-gpu");
System.exit(2);
}
config.setUseGPU(gpu);
config.setGPUDevice(gpu);
}
if (request_time != null) {
String[] intervals = request_time.split(",");
if (intervals != null) {
config.requestTime = new LinkedList<Pair<Calendar, Calendar>>();
config.setRequestTime(new LinkedList<Pair<Calendar, Calendar>>());
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm");
for (String interval : intervals) {
@@ -192,7 +192,7 @@ public class Worker {
}
if (start.before(end)) {
config.requestTime.add(new Pair<Calendar, Calendar>(start, end));
config.getRequestTime().add(new Pair<Calendar, Calendar>(start, end));
}
else {
System.err.println("Error: wrong request time " + times[0] + " is after " + times[1]);
@@ -208,7 +208,7 @@ public class Worker {
return;
}
else {
config.setUseNbCores(nb_cores);
config.setNbCores(nb_cores);
}
if (max_ram != null) {
@@ -274,7 +274,7 @@ public class Worker {
System.exit(2);
}
else if (compute_method == ComputeType.CPU) {
config.setUseGPU(null); // remove the GPU
config.setGPUDevice(null); // remove the GPU
}
config.setComputeMethod(compute_method);
@@ -289,7 +289,7 @@ public class Worker {
System.err.println("Aborting");
System.exit(2);
}
config.setConfigPath(config_file);
config.setConfigFilePath(config_file);
new SettingsLoader(config_file).merge(config);
}
@@ -302,7 +302,7 @@ public class Worker {
}
switch (type) {
case GuiTextOneLine.type:
if (config.getPrintLog()) {
if (config.isPrintLog()) {
System.out.println("OneLine UI can not be used if verbose mode is enabled");
System.exit(2);
}

View File

@@ -121,12 +121,12 @@ public class Settings implements Activity {
JLabel loginLabel = new JLabel("Username:");
login = new JTextField();
login.setText(parent.getConfiguration().login());
login.setText(parent.getConfiguration().getLogin());
login.setColumns(20);
login.addKeyListener(new CheckCanStart());
JLabel passwordLabel = new JLabel("Password:");
password = new JPasswordField();
password.setText(parent.getConfiguration().password());
password.setText(parent.getConfiguration().getPassword());
password.setColumns(10);
password.addKeyListener(new CheckCanStart());
@@ -147,7 +147,7 @@ public class Settings implements Activity {
JLabel cacheLabel = new JLabel("Working directory:");
directory_panel.add(cacheLabel);
String destination = DUMMY_CACHE_DIR;
if (config.getUserHasSpecifiedACacheDir()) {
if (config.isUserHasSpecifiedACacheDir()) {
destination = config.getCacheDirForSettings().getName();
}
@@ -388,7 +388,7 @@ public class Settings implements Activity {
saveFile = new JCheckBox("Save settings", true);
general_panel.add(saveFile);
autoSignIn = new JCheckBox("Auto sign in", config.getAutoSignIn());
autoSignIn = new JCheckBox("Auto sign in", config.isAutoSignIn());
autoSignIn.addActionListener(new AutoSignInChangeAction());
general_panel.add(autoSignIn);
@@ -413,7 +413,7 @@ public class Settings implements Activity {
constraints.gridy = currentRow;
parent.getContentPane().add(saveButton, constraints);
if (haveAutoStarted == false && config.getAutoSignIn() && checkDisplaySaveButton()) {
if (haveAutoStarted == false && config.isAutoSignIn() && checkDisplaySaveButton()) {
// auto start
haveAutoStarted = true;
new SaveAction().actionPerformed(null);
@@ -548,7 +548,7 @@ public class Settings implements Activity {
config.setComputeMethod(method);
if (selected_gpu != null) {
config.setUseGPU(selected_gpu);
config.setGPUDevice(selected_gpu);
}
int cpu_cores = -1;
@@ -557,7 +557,7 @@ public class Settings implements Activity {
}
if (cpu_cores > 0) {
config.setUseNbCores(cpu_cores);
config.setNbCores(cpu_cores);
}
long max_ram = -1;
@@ -609,7 +609,7 @@ public class Settings implements Activity {
parent.setCredentials(login.getText(), new String(password.getPassword()));
String cachePath = null;
if (config.getUserHasSpecifiedACacheDir() && config.getCacheDirForSettings() != null) {
if (config.isUserHasSpecifiedACacheDir() && config.getCacheDirForSettings() != null) {
cachePath = config.getCacheDirForSettings().getAbsolutePath();
}