@Test(expected = IllegalArgumentException.class) public void testPut_null_key() throws Exception { customStorageMap.put(null, "value"); }
@Override public String put(String key, String value) { if (key == null) { throw new IllegalArgumentException(String.format("Cannot put '%s' value when the key is null!", value)); } if (key.contains(SEPARATOR)) { throw new IllegalArgumentException(String.format("Couldn't save message data as the key '%s' contained reserved separator '::'", key)); } String targetKey = key; if (level != null) { targetKey = targetKey.concat(SEPARATOR).concat(level.name()); } if (block != null) { targetKey = targetKey.concat(SEPARATOR).concat(block.name()); } if (order != null) { targetKey = targetKey.concat(SEPARATOR).concat(order.name()); } if (map.containsKey(targetKey)) { return map.put(targetKey, map.get(targetKey).concat(SEPARATOR).concat(value)); } return map.put(targetKey, value); }
CustomStorageMap implements Map<String, String> { @Override public String put(String key, String value) { if (key == null) { throw new IllegalArgumentException(String.format("Cannot put '%s' value when the key is null!", value)); } if (key.contains(SEPARATOR)) { throw new IllegalArgumentException(String.format("Couldn't save message data as the key '%s' contained reserved separator '::'", key)); } String targetKey = key; if (level != null) { targetKey = targetKey.concat(SEPARATOR).concat(level.name()); } if (block != null) { targetKey = targetKey.concat(SEPARATOR).concat(block.name()); } if (order != null) { targetKey = targetKey.concat(SEPARATOR).concat(order.name()); } if (map.containsKey(targetKey)) { return map.put(targetKey, map.get(targetKey).concat(SEPARATOR).concat(value)); } return map.put(targetKey, value); } }
CustomStorageMap implements Map<String, String> { @Override public String put(String key, String value) { if (key == null) { throw new IllegalArgumentException(String.format("Cannot put '%s' value when the key is null!", value)); } if (key.contains(SEPARATOR)) { throw new IllegalArgumentException(String.format("Couldn't save message data as the key '%s' contained reserved separator '::'", key)); } String targetKey = key; if (level != null) { targetKey = targetKey.concat(SEPARATOR).concat(level.name()); } if (block != null) { targetKey = targetKey.concat(SEPARATOR).concat(block.name()); } if (order != null) { targetKey = targetKey.concat(SEPARATOR).concat(order.name()); } if (map.containsKey(targetKey)) { return map.put(targetKey, map.get(targetKey).concat(SEPARATOR).concat(value)); } return map.put(targetKey, value); } CustomStorageMap(Map<String, String> map);  CustomStorageMap(Map<String, String> map, Level level, Block block, Order order); }
CustomStorageMap implements Map<String, String> { @Override public String put(String key, String value) { if (key == null) { throw new IllegalArgumentException(String.format("Cannot put '%s' value when the key is null!", value)); } if (key.contains(SEPARATOR)) { throw new IllegalArgumentException(String.format("Couldn't save message data as the key '%s' contained reserved separator '::'", key)); } String targetKey = key; if (level != null) { targetKey = targetKey.concat(SEPARATOR).concat(level.name()); } if (block != null) { targetKey = targetKey.concat(SEPARATOR).concat(block.name()); } if (order != null) { targetKey = targetKey.concat(SEPARATOR).concat(order.name()); } if (map.containsKey(targetKey)) { return map.put(targetKey, map.get(targetKey).concat(SEPARATOR).concat(value)); } return map.put(targetKey, value); } 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> { @Override public String put(String key, String value) { if (key == null) { throw new IllegalArgumentException(String.format("Cannot put '%s' value when the key is null!", value)); } if (key.contains(SEPARATOR)) { throw new IllegalArgumentException(String.format("Couldn't save message data as the key '%s' contained reserved separator '::'", key)); } String targetKey = key; if (level != null) { targetKey = targetKey.concat(SEPARATOR).concat(level.name()); } if (block != null) { targetKey = targetKey.concat(SEPARATOR).concat(block.name()); } if (order != null) { targetKey = targetKey.concat(SEPARATOR).concat(order.name()); } if (map.containsKey(targetKey)) { return map.put(targetKey, map.get(targetKey).concat(SEPARATOR).concat(value)); } return map.put(targetKey, value); } 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; }