2019-04-15 17:52发布 生成海报
List> androidPics = bizSplashScreen.getAndroidPics(); Map pic; List needDeleteIds = Lists.newArrayList(); List deleteImages = Lists.newArrayList(); for (BizLaunchImage bizLaunchImage : bizLaunchImages) { pic = new HashMap(); pic.put("name", bizLaunchImage.getImageUrl()); pic.put("width", bizLaunchImage.getDeviceWidth()); pic.put("height", bizLaunchImage.getDeviceHeight()); pic.put("flag", bizLaunchImage.getFlag()); if (bizLaunchImage.getPlatform() == PlatformTypeEnum.ANDROID.getType() && androidPics.contains(pic)) { androidPics.remove(pic); } else if (bizLaunchImage.getPlatform() == PlatformTypeEnum.IOS.getType() && iphonePics.contains(pic)) { iphonePics.remove(pic); } else if (bizLaunchImage.getPlatform() == PlatformTypeEnum.IPAD.getType() && ipadPics.contains(pic)) { ipadPics.remove(pic); } else { deleteImages.add(bizLaunchImage.getImageUrl()); needDeleteIds.add(bizLaunchImage.getId()); } }
public boolean equals(Object o) { //1.同一对象,对象相等 if (o == this) return true; //2.类型不是Map,对象不相等 if (!(o instanceof Map)) return false; Map,?> m = (Map,?>) o; //3.size不等,对象不相等 if (m.size() != size()) return false; try { Iterator> i = entrySet().iterator(); while (i.hasNext()) { Entry e = i.next(); K key = e.getKey(); V value = e.getValue(); //4.如果value为空,对应的对象value不为空或者根本没有这个key,对象不相等 if (value == null) { if (!(m.get(key)==null && m.containsKey(key))) return false; } else { //如果value不为空,对应map相同key的value值是否相等,不等则对象不相等 if (!value.equals(m.get(key))) return false; } } } catch (ClassCastException unused) { return false; } catch (NullPointerException unused) { return false; } return true; }