@Test public void testGetAll() throws Throwable { SimpleConfiguration simpleConfiguration = new SimpleConfiguration(); simpleConfiguration.put("testString", ""); String[] result = simpleConfiguration.getAll("testString"); assertEquals(1, result.length, "result.length"); assertEquals("", result[0], "result[0]"); }
public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; Environment env = Environment.getEnvironment(); IntStream.range(0, ret.length).forEachOrdered(i -> ret[i] = env.getProperty(ret[i])); return Arrays.stream(ret).filter(Objects::nonNull).toArray(String[]::new); }
SimpleConfiguration implements Configuration, Serializable { public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; Environment env = Environment.getEnvironment(); IntStream.range(0, ret.length).forEachOrdered(i -> ret[i] = env.getProperty(ret[i])); return Arrays.stream(ret).filter(Objects::nonNull).toArray(String[]::new); } }
SimpleConfiguration implements Configuration, Serializable { public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; Environment env = Environment.getEnvironment(); IntStream.range(0, ret.length).forEachOrdered(i -> ret[i] = env.getProperty(ret[i])); return Arrays.stream(ret).filter(Objects::nonNull).toArray(String[]::new); } SimpleConfiguration();  SimpleConfiguration(Properties props);  SimpleConfiguration(String filename); }
SimpleConfiguration implements Configuration, Serializable { public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; Environment env = Environment.getEnvironment(); IntStream.range(0, ret.length).forEachOrdered(i -> ret[i] = env.getProperty(ret[i])); return Arrays.stream(ret).filter(Objects::nonNull).toArray(String[]::new); } SimpleConfiguration();  SimpleConfiguration(Properties props);  SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(String name); int[] getInts(String name); long[] getLongs(String name); double[] getDoubles(String name); boolean[] getBooleans(String name); String get(String name); int getInt(String name); int getInt(String name, int def); long getLong(String name); long getLong(String name, long def); double getDouble(String name); double getDouble(String name, double def); boolean getBoolean(String name); boolean getBoolean(String name, boolean def); void load(String filename); synchronized void put(String name, Object value); @Override Set<String> keySet(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
SimpleConfiguration implements Configuration, Serializable { public String[] getAll (String name) { String[] ret; Object obj = props.get (name); if (obj instanceof String[]) { ret = (String[]) obj; } else if (obj instanceof String) { ret = new String[1]; ret[0] = (String) obj; } else ret = new String[0]; Environment env = Environment.getEnvironment(); IntStream.range(0, ret.length).forEachOrdered(i -> ret[i] = env.getProperty(ret[i])); return Arrays.stream(ret).filter(Objects::nonNull).toArray(String[]::new); } SimpleConfiguration();  SimpleConfiguration(Properties props);  SimpleConfiguration(String filename); String get(String name, String def); String[] getAll(String name); int[] getInts(String name); long[] getLongs(String name); double[] getDoubles(String name); boolean[] getBooleans(String name); String get(String name); int getInt(String name); int getInt(String name, int def); long getLong(String name); long getLong(String name, long def); double getDouble(String name); double getDouble(String name, double def); boolean getBoolean(String name); boolean getBoolean(String name, boolean def); void load(String filename); synchronized void put(String name, Object value); @Override Set<String> keySet(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }