Пример #1
0
  @Override
  public int hashCode() {
    int result = realmFolder.hashCode();
    result = 31 * result + realmFileName.hashCode();
    result = 31 * result + canonicalPath.hashCode();
    result = 31 * result + (key != null ? Arrays.hashCode(key) : 0);
    result = 31 * result + (int) schemaVersion;
    result = 31 * result + (migration != null ? migration.hashCode() : 0);
    result = 31 * result + (deleteRealmIfMigrationNeeded ? 1 : 0);
    result = 31 * result + schemaMediator.hashCode();
    result = 31 * result + durability.hashCode();

    return result;
  }
Пример #2
0
  @Override
  public boolean equals(Object obj) {
    if (this == obj) return true;
    if (obj == null || getClass() != obj.getClass()) return false;

    RealmConfiguration that = (RealmConfiguration) obj;

    if (schemaVersion != that.schemaVersion) return false;
    if (deleteRealmIfMigrationNeeded != that.deleteRealmIfMigrationNeeded) return false;
    if (!realmFolder.equals(that.realmFolder)) return false;
    if (!realmFileName.equals(that.realmFileName)) return false;
    if (!canonicalPath.equals(that.canonicalPath)) return false;
    if (!Arrays.equals(key, that.key)) return false;
    if (!durability.equals(that.durability)) return false;
    if (migration != null ? !migration.equals(that.migration) : that.migration != null)
      return false;
    return schemaMediator.equals(that.schemaMediator);
  }