Skip to content

Commit

Permalink
Unwrap optional type in member field and avoid NPE from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Duda committed Nov 26, 2019
1 parent f62344e commit 88be24d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/codingchili/Model/ImportEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ImportEvent {
private FileParser parser;
private Boolean clearExisting;
private String mapping;
private Optional<String> pipeline;
private String pipeline;
private String index;
private String uploadId;
private int offset;
Expand Down Expand Up @@ -140,11 +140,11 @@ public ImportEvent setIndex(String index) {
}

public Optional<String> getPipeline() {
return pipeline;
return Optional.ofNullable(pipeline);
}

public ImportEvent setPipeline(String pipeline) {
this.pipeline = Optional.ofNullable(pipeline);
this.pipeline = pipeline;
return this;
}

Expand Down

0 comments on commit 88be24d

Please sign in to comment.