Skip to content

Commit 8b6005c

Browse files
SUPERCILEXsamtstern
authored andcommitted
Use proper List equals/hashCode/toString methods (#19)
1 parent 9744199 commit 8b6005c

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

database/src/main/java/com/firebase/ui/database/FirebaseArray.java

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -130,30 +130,4 @@ private int getIndexForKey(String key) {
130130
protected List<DataSnapshot> getSnapshots() {
131131
return mSnapshots;
132132
}
133-
134-
@Override
135-
public boolean equals(Object obj) {
136-
if (this == obj) return true;
137-
if (obj == null || getClass() != obj.getClass()) return false;
138-
139-
FirebaseArray snapshots = (FirebaseArray) obj;
140-
141-
return mQuery.equals(snapshots.mQuery) && mSnapshots.equals(snapshots.mSnapshots);
142-
}
143-
144-
@Override
145-
public int hashCode() {
146-
int result = mQuery.hashCode();
147-
result = 31 * result + mSnapshots.hashCode();
148-
return result;
149-
}
150-
151-
@Override
152-
public String toString() {
153-
if (isListening()) {
154-
return "FirebaseArray is listening at " + mQuery + ":\n" + mSnapshots;
155-
} else {
156-
return "FirebaseArray is inactive";
157-
}
158-
}
159133
}

database/src/main/java/com/firebase/ui/database/FirebaseIndexArray.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -206,34 +206,6 @@ private void onKeyRemoved(DataSnapshot data, int index) {
206206
}
207207
}
208208

209-
@Override
210-
public boolean equals(Object obj) {
211-
if (this == obj) return true;
212-
if (obj == null || getClass() != obj.getClass()) return false;
213-
if (!super.equals(obj)) return false;
214-
215-
FirebaseIndexArray array = (FirebaseIndexArray) obj;
216-
217-
return mDataRef.equals(array.mDataRef) && mDataSnapshots.equals(array.mDataSnapshots);
218-
}
219-
220-
@Override
221-
public int hashCode() {
222-
int result = super.hashCode();
223-
result = 31 * result + mDataRef.hashCode();
224-
result = 31 * result + mDataSnapshots.hashCode();
225-
return result;
226-
}
227-
228-
@Override
229-
public String toString() {
230-
if (isListening()) {
231-
return "FirebaseIndexArray is listening at " + mDataRef + ":\n" + mDataSnapshots;
232-
} else {
233-
return "FirebaseIndexArray is inactive";
234-
}
235-
}
236-
237209
/**
238210
* A ValueEventListener attached to the joined child data.
239211
*/

0 commit comments

Comments
 (0)