Merge main with Lombok cleanup into native-tray-quit
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package de.neitzel.core.commandline;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.Singular;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* The `Parameter` class defines a command-line parameter with associated metadata,
|
||||
* such as constraints on the number of values it accepts, descriptions, and aliases.
|
||||
@@ -21,6 +21,7 @@ import java.util.function.Consumer;
|
||||
@Builder
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class Parameter {
|
||||
|
||||
/**
|
||||
@@ -165,30 +166,4 @@ public class Parameter {
|
||||
public Parameter() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new Parameter with the given attributes.
|
||||
*
|
||||
* @param name The name of the parameter.
|
||||
* @param minNumberValues The minimum number of values allowed for this parameter.
|
||||
* @param maxNumberValues The maximum number of values allowed for this parameter.
|
||||
* @param multipleEntries Indicates whether multiple entries are allowed for this parameter.
|
||||
* @param shortDescription A brief description of the parameter.
|
||||
* @param longDescription A detailed description of the parameter.
|
||||
* @param callback A consumer function that processes a list of values associated with this parameter.
|
||||
* @param isHelpCommand Indicates whether this parameter represents a help command.
|
||||
* @param isDefaultParameter Indicates whether this parameter is the default parameter.
|
||||
* @param aliasList A list of aliases for this parameter.
|
||||
*/
|
||||
public Parameter(String name, int minNumberValues, int maxNumberValues, boolean multipleEntries, String shortDescription, String longDescription, Consumer<List<String>> callback, boolean isHelpCommand, boolean isDefaultParameter, List<String> aliasList) {
|
||||
this.name = name;
|
||||
this.minNumberValues = minNumberValues;
|
||||
this.maxNumberValues = maxNumberValues;
|
||||
this.multipleEntries = multipleEntries;
|
||||
this.shortDescription = shortDescription;
|
||||
this.longDescription = longDescription;
|
||||
this.callback = callback;
|
||||
this.isHelpCommand = isHelpCommand;
|
||||
this.isDefaultParameter = isDefaultParameter;
|
||||
this.aliasList = aliasList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package de.neitzel.core.config;
|
||||
|
||||
import de.neitzel.core.io.FileUtils;
|
||||
import de.neitzel.core.util.Strings;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
@@ -14,6 +12,8 @@ import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Provides a utility class for managing configuration properties in an
|
||||
@@ -22,6 +22,7 @@ import java.util.Properties;
|
||||
* and updating properties.
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class Configuration {
|
||||
|
||||
/**
|
||||
@@ -43,15 +44,6 @@ public class Configuration {
|
||||
this(new Properties());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new Configuration instance using the provided properties.
|
||||
*
|
||||
* @param properties the Properties object containing configuration key-value pairs
|
||||
*/
|
||||
public Configuration(final Properties properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a boolean property value associated with the specified key. If the key does not exist in the properties,
|
||||
* the provided default value is returned. The method also supports interpreting specific string values as true.
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Comparator;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* A utility class for creating and managing a temporary directory.
|
||||
@@ -23,6 +24,7 @@ public class TempDirectory implements AutoCloseable {
|
||||
* The directory can be used to safely store temporary runtime files. It is automatically
|
||||
* deleted along with its content when the associated TempDirectory object is closed.
|
||||
*/
|
||||
@Getter
|
||||
private final Path directory;
|
||||
|
||||
/**
|
||||
@@ -37,15 +39,6 @@ public class TempDirectory implements AutoCloseable {
|
||||
this.directory = Files.createTempDirectory(prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the path of the temporary directory associated with this instance.
|
||||
*
|
||||
* @return the {@code Path} of the temporary directory
|
||||
*/
|
||||
public Path getDirectory() {
|
||||
return directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the temporary directory by cleaning up its contents and deleting the directory itself.
|
||||
* <p>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package de.neitzel.core.sql;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -19,6 +16,9 @@ import java.util.Spliterators;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.stream.StreamSupport;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* A generic class for managing SQL queries and their execution using JDBC.
|
||||
@@ -28,6 +28,7 @@ import java.util.stream.StreamSupport;
|
||||
* @param <T> The type of the objects returned by the query.
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
public class Query<T> {
|
||||
|
||||
/**
|
||||
@@ -74,15 +75,6 @@ public class Query<T> {
|
||||
*/
|
||||
private String queryText;
|
||||
|
||||
/**
|
||||
* Constructs a new Query object with the given database connection.
|
||||
*
|
||||
* @param connection The Connection object used to interact with the database.
|
||||
*/
|
||||
public Query(Connection connection) {
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the given SQL query using the provided database connection.
|
||||
*
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.sql.Time;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Calendar;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* A wrapper implementation of the {@link ResultSet} interface that modifies or intercepts
|
||||
@@ -31,6 +32,7 @@ import java.util.Map;
|
||||
* If any additional behaviors or transformations are applied, they are documented
|
||||
* in the respective overridden method descriptions.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class TrimmingResultSet implements ResultSet {
|
||||
|
||||
/**
|
||||
@@ -44,15 +46,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
*/
|
||||
private final ResultSet resultSet;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the TrimmingResultSet class, wrapping the provided ResultSet.
|
||||
*
|
||||
* @param resultSet the ResultSet to be wrapped and processed by this TrimmingResultSet instance
|
||||
*/
|
||||
public TrimmingResultSet(ResultSet resultSet) {
|
||||
this.resultSet = resultSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves the cursor forward one row from its current position in the ResultSet.
|
||||
*
|
||||
@@ -933,18 +926,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
return resultSet.getNCharacterStream(columnLabel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the value of the designated column in the current row of this ResultSet object
|
||||
* as an Object in the Java programming language. The value will be converted to the specified
|
||||
@@ -965,8 +946,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
return resultSet.getObject(columnIndex, map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the value of the specified column as a {@link Ref} object.
|
||||
*
|
||||
@@ -979,8 +958,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
return resultSet.getRef(columnIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the Blob object designated by the given column index from the current row of the result set.
|
||||
*
|
||||
@@ -993,8 +970,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
return resultSet.getBlob(columnIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the CLOB value at the specified column index from the underlying ResultSet.
|
||||
*
|
||||
@@ -1007,8 +982,6 @@ public class TrimmingResultSet implements ResultSet {
|
||||
return resultSet.getClob(columnIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves an SQL Array object from the specified column index
|
||||
* of the current row in the ResultSet.
|
||||
|
||||
Reference in New Issue
Block a user