Skip to content

Commit f831386

Browse files
fragarsiefragarsie
fragarsie
authored and
fragarsie
committed
- Update dependencies
- Added listen query collections con RxFirestore package - Added unitary tests for basic RxFirestore methods - Fixed bug in query existence predicate - Rename TypedMapDocumentSnapshotMapper to TypedMapQuerySnapshotMapper
1 parent 019ce80 commit f831386

File tree

4 files changed

+638
-11
lines changed

4 files changed

+638
-11
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
22
ext {
3-
rx_version = "2.1.8"
3+
rx_version = "2.1.10"
44
rx_android_version = "2.0.1"
55
firebase_version = "11.8.0"
66
support_version = "26.1.0"

app/src/main/java/durdinapps/rxfirebase2/DocumentSnapshotMapper.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ public static <U> DocumentSnapshotMapper<DocumentSnapshot, U> of(Class<U> clazz)
2323
}
2424

2525
public static <U> DocumentSnapshotMapper<QuerySnapshot, List<U>> listOf(Class<U> clazz) {
26-
return new DocumentSnapshotMapper.TypedListDocumentSnapshotMapper<>(clazz);
26+
return new TypedListQuerySnapshotMapper<>(clazz);
2727
}
2828

2929
public static <U> DocumentSnapshotMapper<QuerySnapshot, List<U>> listOf(Class<U> clazz, Function<DocumentSnapshot, U> mapper) {
30-
return new DocumentSnapshotMapper.TypedListDocumentSnapshotMapper<>(clazz, mapper);
30+
return new TypedListQuerySnapshotMapper<>(clazz, mapper);
3131
}
3232

33-
public static <U> TypedMapDocumentSnapshotMapper<U> mapOf(Class<U> clazz) {
34-
return new DocumentSnapshotMapper.TypedMapDocumentSnapshotMapper<>(clazz);
33+
public static <U> TypedMapQuerySnapshotMapper<U> mapOf(Class<U> clazz) {
34+
return new TypedMapQuerySnapshotMapper<>(clazz);
3535
}
3636

3737
private static <U> U getDataSnapshotTypedValue(DocumentSnapshot documentSnapshot, Class<U> clazz) {
@@ -52,16 +52,16 @@ public U apply(final DocumentSnapshot documentSnapshot) {
5252
}
5353
}
5454

55-
private static class TypedListDocumentSnapshotMapper<U> extends DocumentSnapshotMapper<QuerySnapshot, List<U>> {
55+
private static class TypedListQuerySnapshotMapper<U> extends DocumentSnapshotMapper<QuerySnapshot, List<U>> {
5656

5757
private final Class<U> clazz;
5858
private final Function<DocumentSnapshot, U> mapper;
5959

60-
TypedListDocumentSnapshotMapper(final Class<U> clazz) {
60+
TypedListQuerySnapshotMapper(final Class<U> clazz) {
6161
this(clazz, null);
6262
}
6363

64-
TypedListDocumentSnapshotMapper(final Class<U> clazz, Function<DocumentSnapshot, U> mapper) {
64+
TypedListQuerySnapshotMapper(final Class<U> clazz, Function<DocumentSnapshot, U> mapper) {
6565
this.clazz = clazz;
6666
this.mapper = mapper;
6767
}
@@ -79,11 +79,11 @@ public List<U> apply(final QuerySnapshot querySnapshot) throws Exception {
7979
}
8080

8181

82-
private static class TypedMapDocumentSnapshotMapper<U> extends DocumentSnapshotMapper<QuerySnapshot, LinkedHashMap<String, U>> {
82+
private static class TypedMapQuerySnapshotMapper<U> extends DocumentSnapshotMapper<QuerySnapshot, LinkedHashMap<String, U>> {
8383

8484
private final Class<U> clazz;
8585

86-
TypedMapDocumentSnapshotMapper(final Class<U> clazz) {
86+
TypedMapQuerySnapshotMapper(final Class<U> clazz) {
8787
this.clazz = clazz;
8888
}
8989

@@ -100,7 +100,7 @@ public LinkedHashMap<String, U> apply(final QuerySnapshot querySnapshot) {
100100
static final Predicate<QuerySnapshot> QUERY_EXISTENCE_PREDICATE = new Predicate<QuerySnapshot>() {
101101
@Override
102102
public boolean test(@NonNull QuerySnapshot querySnapshot) throws Exception {
103-
return querySnapshot.isEmpty();
103+
return !querySnapshot.isEmpty();
104104
}
105105
};
106106

0 commit comments

Comments
 (0)