summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcae/CLIUtils.java
diff options
context:
space:
mode:
authorPawelSzalapski <pawel.szalapski@nokia.com>2018-07-31 08:18:03 +0200
committerPawelSzalapski <pawel.szalapski@nokia.com>2018-08-01 09:56:00 +0200
commitfc073344d4c0eb8a28bf34c07a8439176cf846ca (patch)
tree01f5b4789c3d9369eaebb54a9f910a9fa400af1f /src/main/java/org/onap/dcae/CLIUtils.java
parentd12cd3525284cc41414d8fdae09e2ffbc03a1fbb (diff)
Replace nsaCore library with Spring
Change-Id: I2227939a67a2cbba2d392136d49ef4419600d186 Issue-ID: DCAEGEN2-602 Signed-off-by: PawelSzalapski <pawel.szalapski@nokia.com>
Diffstat (limited to 'src/main/java/org/onap/dcae/CLIUtils.java')
-rw-r--r--src/main/java/org/onap/dcae/CLIUtils.java31
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);
}