@Test public void testNotEquals() { final Bundle left = new Bundle(); left.putInt("int", 9); left.putDouble("double", 1.D); final Bundle right = new Bundle(); right.putInt("int2", 9); right.putDouble("double", 1.D); assertFalse(BundleUtils.equals(left, right)); }
public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<String> rightSet = right.keySet(); if (leftSet.size() != rightSet.size()) { return false; } Object leftValue; Object rightValue; for (String key: leftSet) { if (!rightSet.contains(key)) { return false; } leftValue = left.get(key); rightValue = right.get(key); if (leftValue instanceof Bundle) { if (!(rightValue instanceof Bundle)) { return false; } if (!BundleUtils.equals((Bundle) leftValue, (Bundle) rightValue)) { return false; } } if (leftValue != null ? !leftValue.equals(rightValue) : rightValue != null) { return false; } } return true; }
BundleUtils { public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<String> rightSet = right.keySet(); if (leftSet.size() != rightSet.size()) { return false; } Object leftValue; Object rightValue; for (String key: leftSet) { if (!rightSet.contains(key)) { return false; } leftValue = left.get(key); rightValue = right.get(key); if (leftValue instanceof Bundle) { if (!(rightValue instanceof Bundle)) { return false; } if (!BundleUtils.equals((Bundle) leftValue, (Bundle) rightValue)) { return false; } } if (leftValue != null ? !leftValue.equals(rightValue) : rightValue != null) { return false; } } return true; } }
BundleUtils { public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<String> rightSet = right.keySet(); if (leftSet.size() != rightSet.size()) { return false; } Object leftValue; Object rightValue; for (String key: leftSet) { if (!rightSet.contains(key)) { return false; } leftValue = left.get(key); rightValue = right.get(key); if (leftValue instanceof Bundle) { if (!(rightValue instanceof Bundle)) { return false; } if (!BundleUtils.equals((Bundle) leftValue, (Bundle) rightValue)) { return false; } } if (leftValue != null ? !leftValue.equals(rightValue) : rightValue != null) { return false; } } return true; } private  BundleUtils(); }
BundleUtils { public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<String> rightSet = right.keySet(); if (leftSet.size() != rightSet.size()) { return false; } Object leftValue; Object rightValue; for (String key: leftSet) { if (!rightSet.contains(key)) { return false; } leftValue = left.get(key); rightValue = right.get(key); if (leftValue instanceof Bundle) { if (!(rightValue instanceof Bundle)) { return false; } if (!BundleUtils.equals((Bundle) leftValue, (Bundle) rightValue)) { return false; } } if (leftValue != null ? !leftValue.equals(rightValue) : rightValue != null) { return false; } } return true; } private  BundleUtils(); static boolean equals(Bundle left, Bundle right); static String dump(Bundle bundle); static Bundle mutate(Bundle bundle); }
BundleUtils { public static boolean equals(Bundle left, Bundle right) { if (left == right) { return true; } if (left == null || right == null) { return false; } final Set<String> leftSet = left.keySet(); final Set<String> rightSet = right.keySet(); if (leftSet.size() != rightSet.size()) { return false; } Object leftValue; Object rightValue; for (String key: leftSet) { if (!rightSet.contains(key)) { return false; } leftValue = left.get(key); rightValue = right.get(key); if (leftValue instanceof Bundle) { if (!(rightValue instanceof Bundle)) { return false; } if (!BundleUtils.equals((Bundle) leftValue, (Bundle) rightValue)) { return false; } } if (leftValue != null ? !leftValue.equals(rightValue) : rightValue != null) { return false; } } return true; } private  BundleUtils(); static boolean equals(Bundle left, Bundle right); static String dump(Bundle bundle); static Bundle mutate(Bundle bundle);  }