forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
This commit is contained in:
@@ -16,6 +16,12 @@ import java.util.*;
|
||||
*/
|
||||
public final class CodegenConfiguratorUtils {
|
||||
|
||||
public static void applySystemPropertiesKvpList(List<String> systemProperties, CodegenConfigurator configurator) {
|
||||
for(String propString : systemProperties) {
|
||||
applySystemPropertiesKvp(propString, configurator);
|
||||
}
|
||||
}
|
||||
|
||||
public static void applySystemPropertiesKvp(String systemProperties, CodegenConfigurator configurator) {
|
||||
final Map<String, String> map = createMapFromKeyValuePairs(systemProperties);
|
||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||
@@ -81,6 +87,4 @@ public final class CodegenConfiguratorUtils {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,28 +2,29 @@ package io.swagger.codegen.utils;
|
||||
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import joptsimple.internal.Strings;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
public class OptionUtils {
|
||||
|
||||
public static List<Pair<String, String>> parseCommaSeparatedTuples(String input) {
|
||||
public static List<Pair<String, String>> parseCommaSeparatedTuples(final String input) {
|
||||
|
||||
List<Pair<String, String>> results = new ArrayList<Pair<String, String>>();
|
||||
final List<Pair<String, String>> results = new ArrayList<Pair<String, String>>();
|
||||
|
||||
final List<String> tuples = splitCommaSeparatedList(input);
|
||||
|
||||
for (String tuple : tuples) {
|
||||
int ix = tuple.indexOf('=');
|
||||
if (ix > 0 && ix < tuple.length() - 1) {
|
||||
if (ix > 0 && ix <= tuple.length() - 1) {
|
||||
final Pair<String, String> pair = Pair.of(tuple.substring(0, ix), tuple.substring(ix + 1));
|
||||
results.add(pair);
|
||||
} else if (ix < 0){
|
||||
final Pair<String, String> pair = Pair.of(tuple, "");
|
||||
results.add(pair);
|
||||
}
|
||||
}
|
||||
//Strings.isNullOrEmpty(input)
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user