Skip to content

Commit

Permalink
#126: Fix @optional annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabrina Wullschleger committed Mar 8, 2024
1 parent d6aad65 commit 84143ec
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 23 deletions.
23 changes: 16 additions & 7 deletions gretl/src/main/java/ch/so/agi/gretl/tasks/Csv2Excel.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import ch.so.agi.gretl.logging.LogEnvironment;
import ch.so.agi.gretl.steps.Csv2ExcelStep;

import javax.annotation.Nullable;

public class Csv2Excel extends DefaultTask {
protected GretlLogger log;

Expand All @@ -34,37 +36,44 @@ public File getCsvFile() {
return csvFile;
}

@Optional
@Internal
@Nullable
public Boolean isFirstLineIsHeader() {
return firstLineIsHeader;
}

@Optional
@Internal
@Nullable
public Character getValueDelimiter() {
return valueDelimiter;
}

@Optional
@Internal
@Nullable
public Character getValueSeparator() {
return valueSeparator;
}

@Optional
@Internal
@Nullable
public String getEncoding() {
return encoding;
}

@Optional
@Internal
@Nullable
public String getModels() {
return models;
}

@Optional
@Internal
@Nullable
public String getModeldir() {
return modeldir;
}

@Optional
@Internal
@Nullable
public File getOutputDir() {
return outputDir;
}
Expand Down
23 changes: 16 additions & 7 deletions gretl/src/main/java/ch/so/agi/gretl/tasks/Csv2Parquet.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import ch.so.agi.gretl.logging.LogEnvironment;
import ch.so.agi.gretl.steps.Csv2ParquetStep;

import javax.annotation.Nullable;

public class Csv2Parquet extends DefaultTask {
protected GretlLogger log;

Expand All @@ -34,37 +36,44 @@ public File getCsvFile() {
return csvFile;
}

@Optional
@Internal
@Nullable
public Boolean isFirstLineIsHeader() {
return firstLineIsHeader;
}

@Optional
@Internal
@Nullable
public Character getValueDelimiter() {
return valueDelimiter;
}

@Optional
@Internal
@Nullable
public Character getValueSeparator() {
return valueSeparator;
}

@Optional
@Internal
@Nullable
public String getEncoding() {
return encoding;
}

@Optional
@Internal
@Nullable
public String getModels() {
return models;
}

@Optional
@Internal
@Nullable
public String getModeldir() {
return modeldir;
}

@Optional
@Internal
@Nullable
public File getOutputDir() {
return outputDir;
}
Expand Down
4 changes: 2 additions & 2 deletions gretl/src/main/java/ch/so/agi/gretl/tasks/CsvImport.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CsvImport extends DefaultTask {
private Connector database;
private Object dataFile = null;
private String tableName = null;
private boolean firstLineIsHeader = true;
private Boolean firstLineIsHeader = true;
private Character valueDelimiter = null;
private Character valueSeparator = null;
private String schemaName = null;
Expand All @@ -47,7 +47,7 @@ public String getTableName() {

@Input
@Optional
public boolean isFirstLineIsHeader() {
public Boolean isFirstLineIsHeader() {
return firstLineIsHeader;
}

Expand Down
23 changes: 16 additions & 7 deletions gretl/src/main/java/ch/so/agi/gretl/tasks/Curl.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MultipartEntityBuilder;

import javax.annotation.Nullable;


// README.md eventuell
// abstract class geht erst mit 5.6 oder so. Nicht mit 5.1.1
Expand Down Expand Up @@ -70,37 +72,44 @@ public int getExpectedStatusCode() {
return expectedStatusCode;
}

@Optional
@Internal
@Nullable
public String getExpectedBody() {
return expectedBody;
}

@Optional
@Internal
@Nullable
public Map<String, Object> getFormData() {
return formData;
}

@Optional
@Internal
@Nullable
public File getOutputFile() {
return outputFile;
}

@Optional
@Internal
@Nullable
public File getDataBinary() {
return dataBinary;
}

@Optional
@Internal
@Nullable
public Map<String, String> getHeaders() {
return headers;
}

@Optional
@Internal
@Nullable
public String getUser() {
return user;
}

@Optional
@Internal
@Nullable
public String getPassword() {
return password;
}
Expand Down

0 comments on commit 84143ec

Please sign in to comment.