@Override
 public int hashCode() {
   int hashCode = getClass().hashCode();
   hashCode = 13 * hashCode + ObjectUtils.nullSafeHashCode(this.beanFactory);
   hashCode = 13 * hashCode + ObjectUtils.nullSafeHashCode(this.targetBeanName);
   return hashCode;
 }
 @Override
 public int hashCode() {
   int hashCode = ObjectUtils.nullSafeHashCode(this.getExpression());
   hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutDeclarationScope);
   hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterNames);
   hashCode = 31 * hashCode + ObjectUtils.nullSafeHashCode(this.pointcutParameterTypes);
   return hashCode;
 }
Exemplo n.º 3
0
 @Override
 public int hashCode() {
   int hashCode = ObjectUtils.nullSafeHashCode(getReadMethod());
   hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getWriteMethod());
   hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getIndexedReadMethod());
   hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getIndexedWriteMethod());
   return hashCode;
 }
Exemplo n.º 4
0
 @Override
 public int hashCode() {
   int hashValue = 17;
   hashValue = 37 * hashValue + ObjectUtils.nullSafeHashCode(getId());
   hashValue = 37 * hashValue + ObjectUtils.nullSafeHashCode(getFirstName());
   hashValue = 37 * hashValue + ObjectUtils.nullSafeHashCode(getLastName());
   return hashValue;
 }
Exemplo n.º 5
0
 @Override
 public int hashCode() {
   int result = 1;
   result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.name);
   result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.reset);
   result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.proxyTargetAware);
   result = MULTIPLIER * result + ObjectUtils.nullSafeHashCode(this.qualifier);
   return result;
 }
Exemplo n.º 6
0
 @Override
 public int hashCode() {
   int hashCode = super.hashCode();
   hashCode = 29 * hashCode + getField().hashCode();
   hashCode = 29 * hashCode + ObjectUtils.nullSafeHashCode(getRejectedValue());
   hashCode = 29 * hashCode + (isBindingFailure() ? 1 : 0);
   return hashCode;
 }
Exemplo n.º 7
0
  /**
   * This method uses reflection to build a valid hash code.
   *
   * <p>It uses <code>AccessibleObject.setAccessible</code> to gain access to private fields. This
   * means that it will throw a security exception if run under a security manager, if the
   * permissions are not set up correctly. It is also not as efficient as testing explicitly.
   *
   * <p>Transient members will not be used, as they are likely derived fields, and not part of the
   * value of the <code>Object</code>.
   *
   * <p>Static fields will not be tested. Superclass fields will be included.
   *
   * @param obj the object to create a <code>hashCode</code> for
   * @return the generated hash code, or zero if the given object is <code>null</code>
   */
  public static int reflectionHashCode(Object obj) {
    if (obj == null) return 0;

    Class<?> targetClass = obj.getClass();
    if (isArrayOfPrimitives(obj)) {
      // || ObjectUtils.isPrimitiveOrWrapper(targetClass)) {
      return ObjectUtils.nullSafeHashCode(obj);
    }

    if (targetClass.isArray()) {
      return reflectionHashCode((Object[]) obj);
    }

    if (obj instanceof Collection) {
      return reflectionHashCode((Collection<?>) obj);
    }

    if (obj instanceof Map) {
      return reflectionHashCode((Map<?, ?>) obj);
    }

    // determine whether the object's class declares hashCode() or has a
    // superClass other than java.lang.Object that declares hashCode()
    Class<?> clazz = (obj instanceof Class) ? (Class<?>) obj : obj.getClass();
    Method hashCodeMethod = ReflectionUtils.findMethod(clazz, "hashCode", new Class[0]);

    if (hashCodeMethod != null) {
      return obj.hashCode();
    }

    // could not find a hashCode other than the one declared by
    // java.lang.Object
    int hash = INITIAL_HASH;

    try {
      while (targetClass != null) {
        Field[] fields = targetClass.getDeclaredFields();
        AccessibleObject.setAccessible(fields, true);

        for (int i = 0; i < fields.length; i++) {
          Field field = fields[i];
          int modifiers = field.getModifiers();

          if (!Modifier.isStatic(modifiers) && !Modifier.isTransient(modifiers)) {
            hash = MULTIPLIER * hash + reflectionHashCode(field.get(obj));
          }
        }
        targetClass = targetClass.getSuperclass();
      }
    } catch (IllegalAccessException exception) {
      // ///CLOVER:OFF
      ReflectionUtils.handleReflectionException(exception);
      // ///CLOVER:ON
    }

    return hash;
  }
Exemplo n.º 8
0
 @Override
 public int hashCode() {
   int hashCode = ObjectUtils.nullSafeHashCode(project);
   return getElementType() * hashCode + super.hashCode();
 }
Exemplo n.º 9
0
 public int hashCode(Object x) throws HibernateException {
   return ObjectUtils.nullSafeHashCode(x);
 }
 @Override
 public int hashCode() {
   return ObjectUtils.nullSafeHashCode(this.connectionPool) * 29
       + ObjectUtils.nullSafeHashCode(this.getGeneral()) * 29
       + ObjectUtils.nullSafeHashCode(this.getConnection()) * 29;
 }
Exemplo n.º 11
0
 @Override
 public int hashCode() {
   int hashCode = ObjectUtils.nullSafeHashCode(beanClass);
   return 29 * hashCode + ObjectUtils.nullSafeHashCode(beans);
 }
Exemplo n.º 12
0
 @Override
 public int hashCode() {
   return ObjectUtils.nullSafeHashCode(storage);
 }
 /*
  * (non-Javadoc)
  * @see org.springframework.data.util.TypeDiscoverer#hashCode()
  */
 @Override
 public int hashCode() {
   return super.hashCode() + 31 * ObjectUtils.nullSafeHashCode(parent);
 }
Exemplo n.º 14
0
 /* (non-Javadoc)
  * @see java.lang.Object#hashCode()
  */
 @Override
 public int hashCode() {
   return ObjectUtils.nullSafeHashCode(this.id);
 }
 @Override
 public final int hashCode() {
   return ObjectUtils.nullSafeHashCode(this.key) ^ ObjectUtils.nullSafeHashCode(this.value);
 }
 @Override
 public int hashCode() {
   return ObjectUtils.nullSafeHashCode(this.enabled) * 29
       + ObjectUtils.nullSafeHashCode(this.history) * 29
       + ObjectUtils.nullSafeHashCode(this.threshold) * 29;
 }
Exemplo n.º 17
0
 @Override
 public int hashCode() {
   return super.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.statusCode);
 }
Exemplo n.º 18
0
 @Override
 public int hashCode() {
   return (ObjectUtils.nullSafeHashCode(getReadMethod()) * 29
       + ObjectUtils.nullSafeHashCode(getWriteMethod()));
 }