From e369446c1a10b9d0f881b902a15e6f62e0028200 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Thu, 30 May 2024 22:50:06 +0300 Subject: [PATCH] Add lombok --- pom.xml | 6 ++ .../configuration/Configuration.java | 62 +------------------ .../configuration/ConfigurationModel.java | 34 +--------- .../alyverkko_cli/configuration/Prompt.java | 26 +------- 4 files changed, 13 insertions(+), 115 deletions(-) diff --git a/pom.xml b/pom.xml index 601d99f..d237d39 100644 --- a/pom.xml +++ b/pom.xml @@ -60,6 +60,12 @@ commons-io 1.3.2 + + org.projectlombok + lombok + 1.18.32 + provided + diff --git a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Configuration.java b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Configuration.java index f432664..a37d03d 100644 --- a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Configuration.java +++ b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Configuration.java @@ -3,11 +3,13 @@ package eu.svjatoslav.alyverkko_cli.configuration; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; import java.io.*; import java.util.List; +@Data public class Configuration { private static final String DEFAULT_CONFIG_FILE_PATH = "~/.config/alyverkko-cli.yaml".replaceFirst("^~", System.getProperty("user.home")); @@ -35,10 +37,6 @@ public class Configuration { private List models; - public List getModels() { - return models; - } - public void setModels(List models) { this.models = models; } @@ -66,62 +64,6 @@ public class Configuration { return mapper.readValue(configFile, Configuration.class); } - public List getPrompts() { - return prompts; - } - - public void setPrompts(List prompts) { - this.prompts = prompts; - } - - public File getMailDirectory() { - return mailDirectory; - } - - public void setMailDirectory(File mailDirectory) { - this.mailDirectory = mailDirectory; - } - - public File getModelsDirectory() { - return modelsDirectory; - } - - public void setModelsDirectory(File modelsDirectory) { - this.modelsDirectory = modelsDirectory; - } - - public float getDefaultTemperature() { - return defaultTemperature; - } - - public void setDefaultTemperature(float defaultTemperature) { - this.defaultTemperature = defaultTemperature; - } - - public File getLlamaCppDirPath() { - return llamaCppDirPath; - } - - public void setLlamaCppDirPath(File llamaCppDirPath) { - this.llamaCppDirPath = llamaCppDirPath; - } - - public int getBatchThreadCount() { - return batchThreadCount; - } - - public void setBatchThreadCount(int batchThreadCount) { - this.batchThreadCount = batchThreadCount; - } - - public int getThreadCount() { - return threadCount; - } - - public void setThreadCount(int threadCount) { - this.threadCount = threadCount; - } - public String getPromptByAlias(String alias) { //System.out.println("Prompts: " + prompts); diff --git a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/ConfigurationModel.java b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/ConfigurationModel.java index b3f5640..5116d4a 100644 --- a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/ConfigurationModel.java +++ b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/ConfigurationModel.java @@ -1,7 +1,9 @@ package eu.svjatoslav.alyverkko_cli.configuration; import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; +@Data public class ConfigurationModel { private String alias; @@ -18,36 +20,4 @@ public class ConfigurationModel { @JsonProperty("end_of_text_marker") private String endOfTextMarker; - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public String getFilesystemPath() { - return filesystemPath; - } - - public void setFilesystemPath(String filesystemPath) { - this.filesystemPath = filesystemPath; - } - - public int getContextSizeTokens() { - return contextSizeTokens; - } - - public void setContextSizeTokens(int contextSizeTokens) { - this.contextSizeTokens = contextSizeTokens; - } - - public String getEndOfTextMarker() { - return endOfTextMarker; - } - - public void setEndOfTextMarker(String endOfTextMarker) { - this.endOfTextMarker = endOfTextMarker; - } - } diff --git a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Prompt.java b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Prompt.java index 5c123ef..1bf9d98 100644 --- a/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Prompt.java +++ b/src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Prompt.java @@ -1,31 +1,11 @@ package eu.svjatoslav.alyverkko_cli.configuration; +import lombok.Data; + +@Data public class Prompt { private String alias; private String prompt; - public String getAlias() { - return alias; - } - - public void setAlias(String alias) { - this.alias = alias; - } - - public String getPrompt() { - return prompt; - } - - public void setPrompt(String prompt) { - this.prompt = prompt; - } - - @Override - public String toString() { - return "Prompt{" + - "alias='" + alias + '\'' + - ", prompt='" + prompt + '\'' + - '}'; - } } -- 2.20.1