@Test public void testParse() { final String privatekeys = "abc,\ndef,\naaa\nbbb,\rccc"; final List<String> parsed = configuration.parse(privatekeys); assertEquals(5, parsed.size()); }
@SuppressWarnings("unchecked") protected List<String> parse(final String value) { if (null == value) { return EMPTY_LIST; } final List<String> list = new ArrayList<String>(); final String[] splits = value.split("[,|\\r|\\n]"); for (final String split : splits) { final String target = split.trim(); if (null != target && !target.isEmpty()) { list.add(target); } } return list; }
AbstractConfiguration implements Configuration { @SuppressWarnings("unchecked") protected List<String> parse(final String value) { if (null == value) { return EMPTY_LIST; } final List<String> list = new ArrayList<String>(); final String[] splits = value.split("[,|\\r|\\n]"); for (final String split : splits) { final String target = split.trim(); if (null != target && !target.isEmpty()) { list.add(target); } } return list; } }
AbstractConfiguration implements Configuration { @SuppressWarnings("unchecked") protected List<String> parse(final String value) { if (null == value) { return EMPTY_LIST; } final List<String> list = new ArrayList<String>(); final String[] splits = value.split("[,|\\r|\\n]"); for (final String split : splits) { final String target = split.trim(); if (null != target && !target.isEmpty()) { list.add(target); } } return list; } AbstractConfiguration();  AbstractConfiguration(final boolean readOnly); }
AbstractConfiguration implements Configuration { @SuppressWarnings("unchecked") protected List<String> parse(final String value) { if (null == value) { return EMPTY_LIST; } final List<String> list = new ArrayList<String>(); final String[] splits = value.split("[,|\\r|\\n]"); for (final String split : splits) { final String target = split.trim(); if (null != target && !target.isEmpty()) { list.add(target); } } return list; } AbstractConfiguration();  AbstractConfiguration(final boolean readOnly); Configuration getSubconfiguration(String key); Object get(final String key); @Override String getAsString(final String key, final String defaultValue); @Override boolean getAsBoolean(final String key, final boolean defaultValue); @Override int getAsInt(final String key, final int defaultValue); @Override long getAsLong(final String key, final long defaultValue); @Override double getAsDouble(final String key, final double defaultValue); @Override List<String> getAsList(final String key); }
AbstractConfiguration implements Configuration { @SuppressWarnings("unchecked") protected List<String> parse(final String value) { if (null == value) { return EMPTY_LIST; } final List<String> list = new ArrayList<String>(); final String[] splits = value.split("[,|\\r|\\n]"); for (final String split : splits) { final String target = split.trim(); if (null != target && !target.isEmpty()) { list.add(target); } } return list; } AbstractConfiguration();  AbstractConfiguration(final boolean readOnly); Configuration getSubconfiguration(String key); Object get(final String key); @Override String getAsString(final String key, final String defaultValue); @Override boolean getAsBoolean(final String key, final boolean defaultValue); @Override int getAsInt(final String key, final int defaultValue); @Override long getAsLong(final String key, final long defaultValue); @Override double getAsDouble(final String key, final double defaultValue); @Override List<String> getAsList(final String key);  }