Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
<artifactId>commons-csv</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<optional>true</optional>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
Expand Down
28 changes: 14 additions & 14 deletions core/src/main/java/com/sciencesakura/dbsetup/csv/Import.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.Map;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NonNull;

/**
* An operation which imports the CSV file into the database.
Expand All @@ -48,8 +48,8 @@ public final class Import implements Operation {
* @return the new {@code Import.Builder} instance
* @throws IllegalArgumentException if the CSV file is not found
*/
@NotNull
public static Builder csv(@NotNull String location) {
@NonNull
public static Builder csv(@NonNull String location) {
var urlLocation = Import.class.getClassLoader()
.getResource(requireNonNull(location, "location must not be null"));
if (urlLocation == null) {
Expand All @@ -65,8 +65,8 @@ public static Builder csv(@NotNull String location) {
* @return the new {@code Import.Builder} instance
* @throws IllegalArgumentException if the TSV file is not found
*/
@NotNull
public static Builder tsv(@NotNull String location) {
@NonNull
public static Builder tsv(@NonNull String location) {
return csv(location).withDelimiter('\t');
}

Expand Down Expand Up @@ -186,7 +186,7 @@ private Builder(URL location) {
*
* @return the new {@code Import} instance
*/
@NotNull
@NonNull
public Import build() {
if (built) {
throw new IllegalStateException("already built");
Expand All @@ -202,7 +202,7 @@ public Import build() {
* @param table the table name to import the CSV file
* @return the reference to this object
*/
public Builder into(@NotNull String table) {
public Builder into(@NonNull String table) {
this.table = requireNonNull(table, "table must not be null");
return this;
}
Expand All @@ -215,7 +215,7 @@ public Builder into(@NotNull String table) {
* @param charset the character encoding to read the CSV file
* @return the reference to this object
*/
public Builder withCharset(@NotNull Charset charset) {
public Builder withCharset(@NonNull Charset charset) {
this.charset = requireNonNull(charset, "charset must not be null");
return this;
}
Expand All @@ -228,7 +228,7 @@ public Builder withCharset(@NotNull Charset charset) {
* @param charset the character encoding to read the CSV file
* @return the reference to this object
*/
public Builder withCharset(@NotNull String charset) {
public Builder withCharset(@NonNull String charset) {
requireNonNull(charset, "charset must not be null");
this.charset = Charset.forName(charset);
return this;
Expand All @@ -241,7 +241,7 @@ public Builder withCharset(@NotNull String charset) {
* @param value the default value (nullable)
* @return the reference to this object
*/
public Builder withDefaultValue(@NotNull String column, Object value) {
public Builder withDefaultValue(@NonNull String column, Object value) {
requireNonNull(column, "column must not be null");
defaultValues.put(column, value);
return this;
Expand All @@ -268,7 +268,7 @@ public Builder withDelimiter(char delimiter) {
* @param valueGenerator the value generator to use
* @return the reference to this object
*/
public Builder withGeneratedValue(@NotNull String column, @NotNull ValueGenerator<?> valueGenerator) {
public Builder withGeneratedValue(@NonNull String column, @NonNull ValueGenerator<?> valueGenerator) {
requireNonNull(column, "column must not be null");
requireNonNull(valueGenerator, "valueGenerator must not be null");
valueGenerators.put(column, valueGenerator);
Expand All @@ -283,7 +283,7 @@ public Builder withGeneratedValue(@NotNull String column, @NotNull ValueGenerato
* @param headers the headers of the CSV file
* @return the reference to this object
*/
public Builder withHeader(@NotNull Collection<String> headers) {
public Builder withHeader(@NonNull Collection<String> headers) {
requireNonNull(headers, "headers must not be null");
this.headers = new String[headers.size()];
var i = 0;
Expand All @@ -301,7 +301,7 @@ public Builder withHeader(@NotNull Collection<String> headers) {
* @param headers the headers of the CSV file
* @return the reference to this object
*/
public Builder withHeader(@NotNull String... headers) {
public Builder withHeader(@NonNull String... headers) {
requireNonNull(headers, "headers must not be null");
this.headers = new String[headers.length];
var i = 0;
Expand All @@ -319,7 +319,7 @@ public Builder withHeader(@NotNull String... headers) {
* @param nullString the string to represent null values
* @return the reference to this object
*/
public Builder withNullAs(@NotNull String nullString) {
public Builder withNullAs(@NonNull String nullString) {
this.nullString = requireNonNull(nullString, "nullString must not be null");
return this;
}
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<commons-csv.version>1.14.1</commons-csv.version>
<dbsetup.version>2.1.0</dbsetup.version>
<h2.version>2.4.240</h2.version>
<jetbrains-annotations.version>13.0</jetbrains-annotations.version>
<jspecify.version>1.0.0</jspecify.version>
<junit-jupiter.version>6.0.3</junit-jupiter.version>
</properties>

Expand Down Expand Up @@ -117,11 +117,6 @@
<artifactId>assertj-db</artifactId>
<version>${assertj-db.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>${jetbrains-annotations.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
Expand All @@ -132,6 +127,11 @@
<artifactId>kotlin-test-junit5</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${jspecify.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down