@Test public void testParseData_no_block() throws Exception { final String[] data = CustomStorageMap.parseData("Intermittent Tests::warn"); assertThat(data.length, is(4)); assertThat(data[CustomStorageMap.KEY_INDEX], is("Intermittent Tests")); assertThat(data[CustomStorageMap.LEVEL_INDEX], is("warn")); assertThat(data[CustomStorageMap.BLOCK_INDEX], is("expanded")); assertThat(data[CustomStorageMap.ORDER_INDEX], is("none")); }
public static String[] parseData(String key) { if (!key.contains(SEPARATOR)) { LOG.log(FINE, String.format("Could not split '%s' key, going to use defaults!", key)); return new String[]{key, Level.info.name(), Block.expanded.name(), Order.none.name()}; } final String[] keyData = key.split(SEPARATOR); String plainKey = null; String level = Level.info.name(); String block = Block.expanded.name(); String order = Order.none.name(); for (int i = 0; i < keyData.length; i++) { if (i == 0) { plainKey = keyData[0]; } else { if (valueOfOrNull(keyData[i], Level.class) != null) { level = nameOfOrNull(keyData[i], Level.class); } else if (valueOfOrNull(keyData[i], Block.class) != null) { block = nameOfOrNull(keyData[i], Block.class); } else if (valueOfOrNull(keyData[i], Order.class) != null) { order = nameOfOrNull(keyData[i], Order.class); } } } return new String[]{plainKey, level, block, order}; }
CustomStorageMap implements Map<String, String> { public static String[] parseData(String key) { if (!key.contains(SEPARATOR)) { LOG.log(FINE, String.format("Could not split '%s' key, going to use defaults!", key)); return new String[]{key, Level.info.name(), Block.expanded.name(), Order.none.name()}; } final String[] keyData = key.split(SEPARATOR); String plainKey = null; String level = Level.info.name(); String block = Block.expanded.name(); String order = Order.none.name(); for (int i = 0; i < keyData.length; i++) { if (i == 0) { plainKey = keyData[0]; } else { if (valueOfOrNull(keyData[i], Level.class) != null) { level = nameOfOrNull(keyData[i], Level.class); } else if (valueOfOrNull(keyData[i], Block.class) != null) { block = nameOfOrNull(keyData[i], Block.class); } else if (valueOfOrNull(keyData[i], Order.class) != null) { order = nameOfOrNull(keyData[i], Order.class); } } } return new String[]{plainKey, level, block, order}; } }
CustomStorageMap implements Map<String, String> { public static String[] parseData(String key) { if (!key.contains(SEPARATOR)) { LOG.log(FINE, String.format("Could not split '%s' key, going to use defaults!", key)); return new String[]{key, Level.info.name(), Block.expanded.name(), Order.none.name()}; } final String[] keyData = key.split(SEPARATOR); String plainKey = null; String level = Level.info.name(); String block = Block.expanded.name(); String order = Order.none.name(); for (int i = 0; i < keyData.length; i++) { if (i == 0) { plainKey = keyData[0]; } else { if (valueOfOrNull(keyData[i], Level.class) != null) { level = nameOfOrNull(keyData[i], Level.class); } else if (valueOfOrNull(keyData[i], Block.class) != null) { block = nameOfOrNull(keyData[i], Block.class); } else if (valueOfOrNull(keyData[i], Order.class) != null) { order = nameOfOrNull(keyData[i], Order.class); } } } return new String[]{plainKey, level, block, order}; } CustomStorageMap(Map<String, String> map);  CustomStorageMap(Map<String, String> map, Level level, Block block, Order order); }
CustomStorageMap implements Map<String, String> { public static String[] parseData(String key) { if (!key.contains(SEPARATOR)) { LOG.log(FINE, String.format("Could not split '%s' key, going to use defaults!", key)); return new String[]{key, Level.info.name(), Block.expanded.name(), Order.none.name()}; } final String[] keyData = key.split(SEPARATOR); String plainKey = null; String level = Level.info.name(); String block = Block.expanded.name(); String order = Order.none.name(); for (int i = 0; i < keyData.length; i++) { if (i == 0) { plainKey = keyData[0]; } else { if (valueOfOrNull(keyData[i], Level.class) != null) { level = nameOfOrNull(keyData[i], Level.class); } else if (valueOfOrNull(keyData[i], Block.class) != null) { block = nameOfOrNull(keyData[i], Block.class); } else if (valueOfOrNull(keyData[i], Order.class) != null) { order = nameOfOrNull(keyData[i], Order.class); } } } return new String[]{plainKey, level, block, order}; } CustomStorageMap(Map<String, String> map);  CustomStorageMap(Map<String, String> map, Level level, Block block, Order order); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override String get(Object key); List<String> getAsList(Object key); @Override String put(String key, String value); @Override String remove(Object key); @Override void putAll(@NotNull Map<? extends String, ? extends String> m); @Override void clear(); @NotNull @Override Set<String> keySet(); @NotNull @Override Collection<String> values(); @NotNull @Override Set<Entry<String, String>> entrySet(); static String[] parseData(String key); }
CustomStorageMap implements Map<String, String> { public static String[] parseData(String key) { if (!key.contains(SEPARATOR)) { LOG.log(FINE, String.format("Could not split '%s' key, going to use defaults!", key)); return new String[]{key, Level.info.name(), Block.expanded.name(), Order.none.name()}; } final String[] keyData = key.split(SEPARATOR); String plainKey = null; String level = Level.info.name(); String block = Block.expanded.name(); String order = Order.none.name(); for (int i = 0; i < keyData.length; i++) { if (i == 0) { plainKey = keyData[0]; } else { if (valueOfOrNull(keyData[i], Level.class) != null) { level = nameOfOrNull(keyData[i], Level.class); } else if (valueOfOrNull(keyData[i], Block.class) != null) { block = nameOfOrNull(keyData[i], Block.class); } else if (valueOfOrNull(keyData[i], Order.class) != null) { order = nameOfOrNull(keyData[i], Order.class); } } } return new String[]{plainKey, level, block, order}; } CustomStorageMap(Map<String, String> map);  CustomStorageMap(Map<String, String> map, Level level, Block block, Order order); @Override int size(); @Override boolean isEmpty(); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override String get(Object key); List<String> getAsList(Object key); @Override String put(String key, String value); @Override String remove(Object key); @Override void putAll(@NotNull Map<? extends String, ? extends String> m); @Override void clear(); @NotNull @Override Set<String> keySet(); @NotNull @Override Collection<String> values(); @NotNull @Override Set<Entry<String, String>> entrySet(); static String[] parseData(String key); static final byte KEY_INDEX; static final byte LEVEL_INDEX; static final byte BLOCK_INDEX; static final byte ORDER_INDEX; }