Skip to content

Commit 88be24d

Browse files
author
Robin Duda
committed
Unwrap optional type in member field and avoid NPE from tests.
1 parent f62344e commit 88be24d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/com/codingchili/Model/ImportEvent.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ImportEvent {
2626
private FileParser parser;
2727
private Boolean clearExisting;
2828
private String mapping;
29-
private Optional<String> pipeline;
29+
private String pipeline;
3030
private String index;
3131
private String uploadId;
3232
private int offset;
@@ -140,11 +140,11 @@ public ImportEvent setIndex(String index) {
140140
}
141141

142142
public Optional<String> getPipeline() {
143-
return pipeline;
143+
return Optional.ofNullable(pipeline);
144144
}
145145

146146
public ImportEvent setPipeline(String pipeline) {
147-
this.pipeline = Optional.ofNullable(pipeline);
147+
this.pipeline = pipeline;
148148
return this;
149149
}
150150

0 commit comments

Comments
 (0)