Add lombok
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 30 May 2024 19:50:06 +0000 (22:50 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Thu, 30 May 2024 19:50:06 +0000 (22:50 +0300)
pom.xml
src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Configuration.java
src/main/java/eu/svjatoslav/alyverkko_cli/configuration/ConfigurationModel.java
src/main/java/eu/svjatoslav/alyverkko_cli/configuration/Prompt.java

diff --git a/pom.xml b/pom.xml
index 601d99f..d237d39 100644 (file)
--- a/pom.xml
+++ b/pom.xml
             <artifactId>commons-io</artifactId>
             <version>1.3.2</version>
         </dependency>
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.18.32</version>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>
index f432664..a37d03d 100644 (file)
@@ -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<ConfigurationModel> models;
 
-    public List<ConfigurationModel> getModels() {
-        return models;
-    }
-
     public void setModels(List<ConfigurationModel> models) {
         this.models = models;
     }
@@ -66,62 +64,6 @@ public class Configuration {
         return mapper.readValue(configFile, Configuration.class);
     }
 
-    public List<Prompt> getPrompts() {
-        return prompts;
-    }
-
-    public void setPrompts(List<Prompt> 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);
 
index b3f5640..5116d4a 100644 (file)
@@ -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;
-    }
-
 }
index 5c123ef..1bf9d98 100644 (file)
@@ -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 + '\'' +
-                '}';
-    }
 }