@Test public void schemaEquality_diffSql_equal() { IndexBundle bundle = new IndexBundle("index1", false, Arrays.asList("col1", "col2"), "sql"); IndexBundle other = new IndexBundle("index1", false, Arrays.asList("col1", "col2"), "sql22"); assertThat(bundle.isSchemaEqual(other), is(true)); }
@Override public boolean isSchemaEqual(IndexBundle other) { if (mUnique != other.mUnique) return false; if (mName.startsWith(DEFAULT_PREFIX)) { if (!other.mName.startsWith(DEFAULT_PREFIX)) { return false; } } else if (other.mName.startsWith(DEFAULT_PREFIX)) { return false; } else if (!mName.equals(other.mName)) { return false; } if (mColumnNames != null ? !mColumnNames.equals(other.mColumnNames) : other.mColumnNames != null) { return false; } return true; }
IndexBundle implements SchemaEquality<IndexBundle> { @Override public boolean isSchemaEqual(IndexBundle other) { if (mUnique != other.mUnique) return false; if (mName.startsWith(DEFAULT_PREFIX)) { if (!other.mName.startsWith(DEFAULT_PREFIX)) { return false; } } else if (other.mName.startsWith(DEFAULT_PREFIX)) { return false; } else if (!mName.equals(other.mName)) { return false; } if (mColumnNames != null ? !mColumnNames.equals(other.mColumnNames) : other.mColumnNames != null) { return false; } return true; } }
IndexBundle implements SchemaEquality<IndexBundle> { @Override public boolean isSchemaEqual(IndexBundle other) { if (mUnique != other.mUnique) return false; if (mName.startsWith(DEFAULT_PREFIX)) { if (!other.mName.startsWith(DEFAULT_PREFIX)) { return false; } } else if (other.mName.startsWith(DEFAULT_PREFIX)) { return false; } else if (!mName.equals(other.mName)) { return false; } if (mColumnNames != null ? !mColumnNames.equals(other.mColumnNames) : other.mColumnNames != null) { return false; } return true; } IndexBundle(String name, boolean unique, List<String> columnNames,
            String createSql); }
IndexBundle implements SchemaEquality<IndexBundle> { @Override public boolean isSchemaEqual(IndexBundle other) { if (mUnique != other.mUnique) return false; if (mName.startsWith(DEFAULT_PREFIX)) { if (!other.mName.startsWith(DEFAULT_PREFIX)) { return false; } } else if (other.mName.startsWith(DEFAULT_PREFIX)) { return false; } else if (!mName.equals(other.mName)) { return false; } if (mColumnNames != null ? !mColumnNames.equals(other.mColumnNames) : other.mColumnNames != null) { return false; } return true; } IndexBundle(String name, boolean unique, List<String> columnNames,
            String createSql); String getName(); boolean isUnique(); List<String> getColumnNames(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) String create(String tableName); @Override boolean isSchemaEqual(IndexBundle other); }
IndexBundle implements SchemaEquality<IndexBundle> { @Override public boolean isSchemaEqual(IndexBundle other) { if (mUnique != other.mUnique) return false; if (mName.startsWith(DEFAULT_PREFIX)) { if (!other.mName.startsWith(DEFAULT_PREFIX)) { return false; } } else if (other.mName.startsWith(DEFAULT_PREFIX)) { return false; } else if (!mName.equals(other.mName)) { return false; } if (mColumnNames != null ? !mColumnNames.equals(other.mColumnNames) : other.mColumnNames != null) { return false; } return true; } IndexBundle(String name, boolean unique, List<String> columnNames,
            String createSql); String getName(); boolean isUnique(); List<String> getColumnNames(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) String create(String tableName); @Override boolean isSchemaEqual(IndexBundle other); static final String DEFAULT_PREFIX; }