package com.huawei.hms.framework.common; import java.util.List; import java.util.Map; import java.util.Set; /* loaded from: classes2.dex */ public class ContainerUtils { public static final String FIELD_DELIMITER = "&"; public static final String KEY_VALUE_DELIMITER = "="; public static boolean equals(Map map, Map map2) { if (map == map2) { return true; } if (map == null || map2 == null || map.size() != map2.size()) { return false; } for (Map.Entry entry : map.entrySet()) { if (map2.get(entry.getKey()) != entry.getValue()) { return false; } } return true; } public static int hashCode(Map map) { return toString(map).hashCode(); } public static String toString(Map map) { if (map == null) { return ""; } StringBuilder sb = new StringBuilder(); int i = 0; for (Map.Entry entry : map.entrySet()) { if (i > 0) { sb.append(FIELD_DELIMITER); } sb.append(entry.getKey().toString()); sb.append(KEY_VALUE_DELIMITER); sb.append(entry.getValue().toString()); i++; } return sb.toString(); } public static String toString(Set set) { if (set == null) { return ""; } StringBuilder sb = new StringBuilder(); int i = 0; for (K k : set) { if (i > 0) { sb.append(FIELD_DELIMITER); } sb.append(k.toString()); i++; } return sb.toString(); } public static String toString(List list) { if (list == null) { return ""; } StringBuilder sb = new StringBuilder(); int i = 0; for (K k : list) { if (i > 0) { sb.append(FIELD_DELIMITER); } sb.append(k.toString()); i++; } return sb.toString(); } }