Java Arrays.deepEquals Examples

Java Arrays.deepEquals - 30 examples found. These are the top rated real world Java examples of java.util.Arrays.deepEquals extracted from open source projects. You can rate examples to help us improve the quality of examples.
  @Override
  public boolean equals(final Object o) {
    if (o == this) {
      return true;
    }
    if (o == null) {
      return false;
    }

    if (o instanceof ImmutableOffsetMap) {
      final ImmutableOffsetMap<?, ?> om = (ImmutableOffsetMap<?, ?>) o;
      if (newKeys.isEmpty()
          && offsets == om.offsets()
          && Arrays.deepEquals(objects, om.objects())) {
        return true;
      }
    } else if (o instanceof MutableOffsetMap) {
      final MutableOffsetMap<?, ?> om = (MutableOffsetMap<?, ?>) o;
      if (offsets == om.offsets
          && Arrays.deepEquals(objects, om.objects)
          && newKeys.equals(om.newKeys)) {
        return true;
      }
    } else if (o instanceof Map) {
      final Map<?, ?> om = (Map<?, ?>) o;

      // Size and key sets have to match
      if (size() != om.size() || !keySet().equals(om.keySet())) {
        return false;
      }

      try {
        // Ensure all newKeys are present. Note newKeys is guaranteed to
        // not contain null value.
        for (Entry<K, V> e : newKeys.entrySet()) {
          if (!e.getValue().equals(om.get(e.getKey()))) {
            return false;
          }
        }

        // Ensure all objects are present
        for (Entry<K, Integer> e : offsets.entrySet()) {
          final Object obj = objects[e.getValue()];
          if (!NO_VALUE.equals(obj)) {
            final V v = objectToValue(e.getKey(), obj);
            if (!v.equals(om.get(e.getKey()))) {
              return false;
            }
          }
        }
      } catch (ClassCastException e) {
        // Can be thrown by om.get() and indicate we have incompatible key types
        return false;
      }

      return true;
    }

    return false;
  }
  /**
   * Provides a static, single instance of the application context. This method can be called
   * repeatedly.
   *
   * <p>If the configuration requested differs from one used previously, then the previously-created
   * context is shut down.
   *
   * @return Returns an application context for the given configuration
   */
  public static synchronized ApplicationContext getApplicationContext(
      String[] configLocations, String[] classLocations) throws IOException {
    if (configLocations == null) {
      throw new IllegalArgumentException("configLocations argument is mandatory.");
    }
    if (usedConfiguration != null
        && Arrays.deepEquals(configLocations, usedConfiguration)
        && classLocations != null
        && Arrays.deepEquals(classLocations, usedClassLocations)) {
      // The configuration was used to create the current context
      return instance;
    }
    // The config has changed so close the current context (if any)
    closeApplicationContext();

    if (useLazyLoading || noAutoStart) {
      instance = new VariableFeatureClassPathXmlApplicationContext(configLocations);
    } else {
      instance = new ClassPathXmlApplicationContext(configLocations, false);
    }

    if (classLocations != null) {
      ClassLoader classLoader = buildClassLoader(classLocations);
      instance.setClassLoader(classLoader);
    }

    instance.refresh();

    usedConfiguration = configLocations;
    usedClassLocations = classLocations;

    return instance;
  }
  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    if (!super.equals(o)) return false;

    final A a = (A) o;

    if (a7 != a.a7) return false;
    if (a8 != a.a8) return false;
    if (a9 != a.a9) return false;
    if (a10 != a.a10) return false;
    if (Float.compare(a.a11, a11) != 0) return false;
    if (Double.compare(a.a12, a12) != 0) return false;
    // Probably incorrect - comparing Object[] arrays with Arrays.equals
    if (!Arrays.equals(a1, a.a1)) return false;
    if (!Arrays.deepEquals(a2, a.a2)) return false;
    // Probably incorrect - comparing Object[] arrays with Arrays.equals
    if (!Arrays.equals(a3, a.a3)) return false;
    if (!Arrays.deepEquals(a4, a.a4)) return false;
    if (!Arrays.equals(a5, a.a5)) return false;
    if (!Arrays.deepEquals(a6, a.a6)) return false;
    if (!a13.equals(a.a13)) return false;
    if (!a14.equals(a.a14)) return false;

    return true;
  }
 @Override
 public boolean deepEqual(IAObject obj) {
   if (!(obj instanceof ARecordType)) {
     return false;
   }
   ARecordType rt = (ARecordType) obj;
   return (isOpen == rt.isOpen)
       && Arrays.deepEquals(fieldNames, rt.fieldNames)
       && Arrays.deepEquals(fieldTypes, rt.fieldTypes);
 }
  public Object invokeMethod(String name, String[] parameterTypes, Object[] arguments)
      throws Throwable {
    if (_methodName28.equals(name) && Arrays.deepEquals(_methodParameterTypes28, parameterTypes)) {
      return TableFromAnotherDataSourceServiceUtil.getBeanIdentifier();
    }

    if (_methodName29.equals(name) && Arrays.deepEquals(_methodParameterTypes29, parameterTypes)) {
      TableFromAnotherDataSourceServiceUtil.setBeanIdentifier((java.lang.String) arguments[0]);
    }

    throw new UnsupportedOperationException();
  }
  public Object invokeMethod(String name, String[] parameterTypes, Object[] arguments)
      throws Throwable {
    if (_methodName22.equals(name) && Arrays.deepEquals(_methodParameterTypes22, parameterTypes)) {
      return CalEventAttendeeServiceUtil.getBeanIdentifier();
    }

    if (_methodName23.equals(name) && Arrays.deepEquals(_methodParameterTypes23, parameterTypes)) {
      CalEventAttendeeServiceUtil.setBeanIdentifier((java.lang.String) arguments[0]);
    }

    throw new UnsupportedOperationException();
  }