push(inputDirStr, client, ConfigurationType.valueOf(configType.get()), configName); } else { push(inputDirStr, client); dump(client, ConfigurationType.valueOf(configType.get()), configName); } else { dump(client); Optional<String> patchKey = Optional.ofNullable(ConfigurationOptions.PATCH_KEY.get(cli)); Optional<String> patchValue = Optional.ofNullable(ConfigurationOptions.PATCH_VALUE.get(cli)); patch(client, ConfigurationType.valueOf(configType.get()), configName, patchMode, patchPath, patchKey, patchValue); } else { throw new IllegalArgumentException("Patch requires config type");
ConfigurationType type = ConfigurationType.valueOf(arg0);
@Override public Object apply(List<Object> args, Context context) throws ParseException { String result; // the configuration type to write String arg0 = getArg(0, String.class, args); ConfigurationType type = ConfigurationType.valueOf(arg0); try { if (GLOBAL == type) { result = getGlobalConfig(args); } else if (PROFILER == type) { result = getProfilerConfig(args); } else if (ENRICHMENT == type) { result = getEnrichmentConfig(args); } else if (INDEXING == type) { result = getIndexingConfig(args); } else if (PARSER == type) { result = getParserConfig(args); } else { throw new IllegalArgumentException("Unexpected configuration type: " + type); } } catch(Exception e) { throw new RuntimeException(e); } return result; }