diff options
author | 2018-08-02 03:26:14 +0000 | |
---|---|---|
committer | 2018-08-02 03:26:14 +0000 | |
commit | 654ebdff4c9ec2487b819d2b76273732759de4c7 (patch) | |
tree | 5681e5435d4801be22ef13b9b6263137d5e891f4 /src/main/java/org/onap/dcae/CLIUtils.java | |
parent | ab85ff62566a1fa8ef6b2ee86a93ab741cd434ed (diff) | |
parent | fc073344d4c0eb8a28bf34c07a8439176cf846ca (diff) |
Merge "Replace nsaCore library with Spring"
Diffstat (limited to 'src/main/java/org/onap/dcae/CLIUtils.java')
-rw-r--r-- | src/main/java/org/onap/dcae/CLIUtils.java | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/main/java/org/onap/dcae/CLIUtils.java b/src/main/java/org/onap/dcae/CLIUtils.java index 6450d2e5..6764d5b2 100644 --- a/src/main/java/org/onap/dcae/CLIUtils.java +++ b/src/main/java/org/onap/dcae/CLIUtils.java @@ -24,36 +24,29 @@ package org.onap.dcae; import java.util.HashMap; /** - * CLIUtils extracted from nsaServerLibrary this implementation will be removed once we switch to different API library + * CLIUtils extracted from nsaServerLibrary this implementation will be removed once we switch to different API library */ public class CLIUtils { - public static io.vavr.collection.HashMap<String, String> processCmdLine (String[] args) { - final HashMap<String,String> map = new HashMap<String,String> (); + public static io.vavr.collection.HashMap<String, String> processCmdLine(String[] args) { + final HashMap<String, String> map = new HashMap<String, String>(); String lastKey = null; - for ( String arg : args ) - { - if ( arg.startsWith ( "-" ) ) - { - if ( lastKey != null ) - { - map.put ( lastKey.substring(1), "" ); + for (String arg : args) { + if (arg.startsWith("-")) { + if (lastKey != null) { + map.put(lastKey.substring(1), ""); } lastKey = arg; - } - else - { - if ( lastKey != null ) - { - map.put ( lastKey.substring(1), arg ); + } else { + if (lastKey != null) { + map.put(lastKey.substring(1), arg); } lastKey = null; } } - if ( lastKey != null ) - { - map.put ( lastKey.substring(1), "" ); + if (lastKey != null) { + map.put(lastKey.substring(1), ""); } return io.vavr.collection.HashMap.ofAll(map); } |