Exemplo n.º 1
0
  @Override
  public boolean softEquals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (obj instanceof RecordRvtImpl) {
      return softEquals(((RecordRvtImpl) obj).getRecord());
    }
    if (obj instanceof IdRecordImpl) {
      return softEquals(((IdRecordImpl) obj).getRecord());
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    RecordImpl other = (RecordImpl) obj;

    if (fields == null) {
      if (other.fields != null) {
        return false;
      }
    } else if (!fields.equals(other.fields)) {
      return false;
    }

    if (fieldsToDelete == null) {
      if (other.fieldsToDelete != null) {
        return false;
      }
    } else if (!fieldsToDelete.equals(other.fieldsToDelete)) {
      return false;
    }

    if (id == null) {
      if (other.id != null) {
        return false;
      }
    } else if (!id.equals(other.id)) {
      return false;
    }

    QName nonVersionedRT1 = getRecordTypeName(Scope.NON_VERSIONED);
    QName nonVersionedRT2 = other.getRecordTypeName(Scope.NON_VERSIONED);

    if (nonVersionedRT1 != null
        && nonVersionedRT2 != null
        && !nonVersionedRT1.equals(nonVersionedRT2)) {
      return false;
    }

    return true;
  }