@Test public void testDataOfGenericTypeIndicator() { List<String> values = new ArrayList<>(); values.add("Foo"); values.add("Bar"); GenericTypeIndicator<List<String>> typeIndicator = new GenericTypeIndicator<List<String>>() { }; TestObserver<Optional<List<String>>> sub = TestObserver.create(); RxFirebaseDatabase.dataOf(mockDatabaseReference, typeIndicator).subscribe(sub); verifyAddListenerForSingleValueEvent(); callValueEventOnDataChange(typeIndicator, values); sub.assertComplete(); sub.assertNoErrors(); sub.assertValue(new Predicate<Optional<List<String>>>() { @Override public boolean test(Optional<List<String>> listOptional) throws Exception { return listOptional.isPresent() && "Foo".equals(listOptional.get().get(0)) && "Bar".equals( listOptional.get().get(1)); } }); sub.dispose(); callValueEventOnDataChange(typeIndicator, values); sub.assertValueCount(1); }
@NonNull @CheckResult public static <T> Single<Optional<T>> dataOf(@NonNull DatabaseReference ref, @NonNull Class<T> clazz) { return data(ref).compose(new SingleTransformerOfClazz<>(clazz)); }
RxFirebaseDatabase { @NonNull @CheckResult public static <T> Single<Optional<T>> dataOf(@NonNull DatabaseReference ref, @NonNull Class<T> clazz) { return data(ref).compose(new SingleTransformerOfClazz<>(clazz)); } }
RxFirebaseDatabase { @NonNull @CheckResult public static <T> Single<Optional<T>> dataOf(@NonNull DatabaseReference ref, @NonNull Class<T> clazz) { return data(ref).compose(new SingleTransformerOfClazz<>(clazz)); } private  RxFirebaseDatabase(); }
RxFirebaseDatabase { @NonNull @CheckResult public static <T> Single<Optional<T>> dataOf(@NonNull DatabaseReference ref, @NonNull Class<T> clazz) { return data(ref).compose(new SingleTransformerOfClazz<>(clazz)); } private  RxFirebaseDatabase(); @NonNull @CheckResult static Observable<ChildEvent> childEvents(
      @NonNull DatabaseReference ref); @NonNull @CheckResult static Single<DataSnapshot> data(@NonNull DatabaseReference ref); @NonNull @CheckResult static Observable<DataSnapshot> dataChanges(
      @NonNull DatabaseReference ref); @NonNull @CheckResult static Observable<Optional<T>> dataChangesOf(
      @NonNull DatabaseReference ref, @NonNull Class<T> clazz); @NonNull @CheckResult static Observable<Optional<T>> dataChangesOf(
      @NonNull DatabaseReference ref, @NonNull GenericTypeIndicator<T> typeIndicator); @NonNull @CheckResult static Single<Optional<T>> dataOf(@NonNull DatabaseReference ref,
      @NonNull Class<T> clazz); @NonNull @CheckResult static Single<Optional<T>> dataOf(@NonNull DatabaseReference ref,
      @NonNull GenericTypeIndicator<T> typeIndicator); @NonNull @CheckResult static Completable removeValue(@NonNull DatabaseReference ref); @NonNull @CheckResult static Completable setPriority(@NonNull DatabaseReference ref,
      @NonNull Object priority); @NonNull @CheckResult static Completable setValue(@NonNull DatabaseReference ref,
      @Nullable T value); @NonNull @CheckResult static Completable setValue(@NonNull DatabaseReference ref,
      @Nullable T value, @NonNull Object priority); @NonNull @CheckResult static Completable runTransaction(@NonNull DatabaseReference ref,
      @NonNull Function<MutableData, Transaction.Result> task); @NonNull @CheckResult static Completable runTransaction(@NonNull DatabaseReference ref,
      boolean fireLocalEvents, @NonNull Function<MutableData, Transaction.Result> task); @NonNull @CheckResult static Completable updateChildren(@NonNull DatabaseReference ref,
      @NonNull Map<String, Object> update); }
RxFirebaseDatabase { @NonNull @CheckResult public static <T> Single<Optional<T>> dataOf(@NonNull DatabaseReference ref, @NonNull Class<T> clazz) { return data(ref).compose(new SingleTransformerOfClazz<>(clazz)); } private  RxFirebaseDatabase(); @NonNull @CheckResult static Observable<ChildEvent> childEvents(
      @NonNull DatabaseReference ref); @NonNull @CheckResult static Single<DataSnapshot> data(@NonNull DatabaseReference ref); @NonNull @CheckResult static Observable<DataSnapshot> dataChanges(
      @NonNull DatabaseReference ref); @NonNull @CheckResult static Observable<Optional<T>> dataChangesOf(
      @NonNull DatabaseReference ref, @NonNull Class<T> clazz); @NonNull @CheckResult static Observable<Optional<T>> dataChangesOf(
      @NonNull DatabaseReference ref, @NonNull GenericTypeIndicator<T> typeIndicator); @NonNull @CheckResult static Single<Optional<T>> dataOf(@NonNull DatabaseReference ref,
      @NonNull Class<T> clazz); @NonNull @CheckResult static Single<Optional<T>> dataOf(@NonNull DatabaseReference ref,
      @NonNull GenericTypeIndicator<T> typeIndicator); @NonNull @CheckResult static Completable removeValue(@NonNull DatabaseReference ref); @NonNull @CheckResult static Completable setPriority(@NonNull DatabaseReference ref,
      @NonNull Object priority); @NonNull @CheckResult static Completable setValue(@NonNull DatabaseReference ref,
      @Nullable T value); @NonNull @CheckResult static Completable setValue(@NonNull DatabaseReference ref,
      @Nullable T value, @NonNull Object priority); @NonNull @CheckResult static Completable runTransaction(@NonNull DatabaseReference ref,
      @NonNull Function<MutableData, Transaction.Result> task); @NonNull @CheckResult static Completable runTransaction(@NonNull DatabaseReference ref,
      boolean fireLocalEvents, @NonNull Function<MutableData, Transaction.Result> task); @NonNull @CheckResult static Completable updateChildren(@NonNull DatabaseReference ref,
      @NonNull Map<String, Object> update);  }