@Test public void firebaseToListTest() { LinkedHashMap<String, String> map = new LinkedHashMap<>(); map.put("BLUE", "100"); map.put("RED", "200"); List<ShopItem> listItems = new LinkedList<>(); listItems.add(new ShopItem(ColorsShop.BLUE, 100)); listItems.add(new ShopItem(ColorsShop.RED, 200)); assertThat(Shop.firebaseToListShopItem(map), is(listItems)); }
public static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map) { List<ShopItem> listItem = new ArrayList<>(); if (map != null) { for (Map.Entry<String, String> entry : map.entrySet()) { int value = Integer.parseInt(String.valueOf(entry.getValue())); listItem.add(new ShopItem( ColorsShop.getColorFromString(entry.getKey()), value)); } } return listItem; }
Shop { public static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map) { List<ShopItem> listItem = new ArrayList<>(); if (map != null) { for (Map.Entry<String, String> entry : map.entrySet()) { int value = Integer.parseInt(String.valueOf(entry.getValue())); listItem.add(new ShopItem( ColorsShop.getColorFromString(entry.getKey()), value)); } } return listItem; } }
Shop { public static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map) { List<ShopItem> listItem = new ArrayList<>(); if (map != null) { for (Map.Entry<String, String> entry : map.entrySet()) { int value = Integer.parseInt(String.valueOf(entry.getValue())); listItem.add(new ShopItem( ColorsShop.getColorFromString(entry.getKey()), value)); } } return listItem; } Shop(); }
Shop { public static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map) { List<ShopItem> listItem = new ArrayList<>(); if (map != null) { for (Map.Entry<String, String> entry : map.entrySet()) { int value = Integer.parseInt(String.valueOf(entry.getValue())); listItem.add(new ShopItem( ColorsShop.getColorFromString(entry.getKey()), value)); } } return listItem; } Shop(); static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map); }
Shop { public static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map) { List<ShopItem> listItem = new ArrayList<>(); if (map != null) { for (Map.Entry<String, String> entry : map.entrySet()) { int value = Integer.parseInt(String.valueOf(entry.getValue())); listItem.add(new ShopItem( ColorsShop.getColorFromString(entry.getKey()), value)); } } return listItem; } Shop(); static List<ShopItem> firebaseToListShopItem(HashMap<String, String> map);  }