@Test public void testExpandVariables() throws Exception { String path = getClass().getResource("vars.ini").getPath(); Map<String, String> raw = new HashMap<>(); MapTools.ini2Map(path, raw); Map<String, String> provided = MapTools.providedMap("/u/seqware/provisioned-bundles", "1.0"); Map<String, String> exp = MapTools.expandVariables(raw, provided); assertEquals(raw.size(), exp.size()); assertEquals("b", exp.get("foo")); assertEquals("d", exp.get("bar")); assertEquals("abcde", exp.get("test-multi")); assertEquals("1.0", exp.get("test-bundle-seqware-version")); assertEquals("/u/seqware/provisioned-bundles", exp.get("test-bundle-dir")); assertEquals("/u/seqware/provisioned-bundles", exp.get("test-legacy-bundle-dir")); Integer.parseInt(exp.get("test-random")); Integer.parseInt(exp.get("test-legacy-random")); DatatypeConverter.parseDate(exp.get("test-date")); DatatypeConverter.parseDate(exp.get("test-legacy-date")); DatatypeConverter.parseDateTime(exp.get("test-datetime")); Long.parseLong(exp.get("test-timestamp")); UUID.fromString(exp.get("test-uuid")); }
public static Map<String, String> expandVariables(Map<String, String> raw) { return expandVariables(raw, null); }
MapTools { public static Map<String, String> expandVariables(Map<String, String> raw) { return expandVariables(raw, null); } }
MapTools { public static Map<String, String> expandVariables(Map<String, String> raw) { return expandVariables(raw, null); }  }
MapTools { public static Map<String, String> expandVariables(Map<String, String> raw) { return expandVariables(raw, null); }  static void ini2Map(String iniFile, Map<String, String> hm); static void ini2RichMap(String iniFile, Map<String, Map<String, String>> hm); static void ini2Map(String iniFile, Map<String, String> hm, boolean keyToUpper); static void ini2Map(InputStream iniFile, Map<String, String> hm, boolean keyToUpper); static void cli2Map(String[] args, Map<String, String> hm); static Map mapString2Int(Map map); static void provideBundleVersion(Map<String, String> m, String bundleVersion); static void provideBundleDir(Map<String, String> m, String bundleDir); static Map<String, String> providedMap(String bundleDir, String bundleSeqwareVersion); static String generatedValue(String key); static Map<String, String> expandVariables(Map<String, String> raw); static Map<String, String> expandVariables(Map<String, String> raw, Map<String, String> provided); static Map<String, String> expandVariables(Map<String, String> raw, Map<String, String> provided, boolean allowMissingVars); static Map<String, String> iniString2Map(String iniString); static SortedSet<WorkflowRunParam> createWorkflowRunParameters(HashMap<String, String> map); }
MapTools { public static Map<String, String> expandVariables(Map<String, String> raw) { return expandVariables(raw, null); }  static void ini2Map(String iniFile, Map<String, String> hm); static void ini2RichMap(String iniFile, Map<String, Map<String, String>> hm); static void ini2Map(String iniFile, Map<String, String> hm, boolean keyToUpper); static void ini2Map(InputStream iniFile, Map<String, String> hm, boolean keyToUpper); static void cli2Map(String[] args, Map<String, String> hm); static Map mapString2Int(Map map); static void provideBundleVersion(Map<String, String> m, String bundleVersion); static void provideBundleDir(Map<String, String> m, String bundleDir); static Map<String, String> providedMap(String bundleDir, String bundleSeqwareVersion); static String generatedValue(String key); static Map<String, String> expandVariables(Map<String, String> raw); static Map<String, String> expandVariables(Map<String, String> raw, Map<String, String> provided); static Map<String, String> expandVariables(Map<String, String> raw, Map<String, String> provided, boolean allowMissingVars); static Map<String, String> iniString2Map(String iniString); static SortedSet<WorkflowRunParam> createWorkflowRunParameters(HashMap<String, String> map); static final String VAR_RANDOM; static final String VAR_DATE; static final String VAR_DATETIME; static final String VAR_TIMESTAMP; static final String VAR_UUID; static final String VAR_BUNDLE_DIR; static final String LEGACY_VAR_RANDOM; static final String LEGACY_VAR_DATE; static final String LEGACY_VAR_BUNDLE_DIR; static final String VAR_WORKFLOW_VERSION; }