Skip to content

Commit

Permalink
Simplified conditional statement by using Map.getOrDefault in DockerC…
Browse files Browse the repository at this point in the history
…omposeConfiguration constructor
  • Loading branch information
MukulKolpe authored and manusa committed Oct 8, 2021
1 parent 21ddf9f commit 346ecff
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class DockerComposeConfiguration {
private final String composeFile;
private final boolean ignoreBuild;
public DockerComposeConfiguration(Map<String, String> config) {
basedir = config.containsKey("basedir") ? config.get("basedir") : "src/main/docker";
composeFile = config.containsKey("composeFile") ? config.get("composeFile") : "docker-compose.yml";
ignoreBuild = config.containsKey("ignoreBuild") ? Boolean.parseBoolean(config.get("ignoreBuilder")) : false;
basedir = config.getOrDefault("basedir", "src/main/docker");
composeFile = config.getOrDefault("composerFile", "docker-compose.yml");
ignoreBuild = Boolean.parseBoolean(config.get("ignoreBuild"));
}

String getBasedir() {
Expand Down

0 comments on commit 346ecff

Please sign in to comment.