@Test(expected = DatabaseReferenceNotSetException.class) public void databaseReference2() { Database database = new Database(); database.setValue("test"); Assert.fail(); }
@Override public Promise<Void> setValue(final Object value) { checkDatabaseReference(); return FuturePromise.when(new DatabaseConsumer<FuturePromise<Void>>(this) { @Override public void accept(FuturePromise<Void> voidFuturePromise) { new QuerySetValue(Database.this, getDatabasePath()) .withArgs(value) .with(voidFuturePromise) .execute(); } }); }
Database implements DatabaseDistribution, QueryProvider { @Override public Promise<Void> setValue(final Object value) { checkDatabaseReference(); return FuturePromise.when(new DatabaseConsumer<FuturePromise<Void>>(this) { @Override public void accept(FuturePromise<Void> voidFuturePromise) { new QuerySetValue(Database.this, getDatabasePath()) .withArgs(value) .with(voidFuturePromise) .execute(); } }); } }
Database implements DatabaseDistribution, QueryProvider { @Override public Promise<Void> setValue(final Object value) { checkDatabaseReference(); return FuturePromise.when(new DatabaseConsumer<FuturePromise<Void>>(this) { @Override public void accept(FuturePromise<Void> voidFuturePromise) { new QuerySetValue(Database.this, getDatabasePath()) .withArgs(value) .with(voidFuturePromise) .execute(); } }); } Database(); }
Database implements DatabaseDistribution, QueryProvider { @Override public Promise<Void> setValue(final Object value) { checkDatabaseReference(); return FuturePromise.when(new DatabaseConsumer<FuturePromise<Void>>(this) { @Override public void accept(FuturePromise<Void> voidFuturePromise) { new QuerySetValue(Database.this, getDatabasePath()) .withArgs(value) .with(voidFuturePromise) .execute(); } }); } Database(); @Override ListenerPromise<ConnectionStatus> onConnect(); @Override DatabaseDistribution inReference(String databasePath); @Override Promise<Void> setValue(final Object value); @Override @SuppressWarnings("unchecked") Promise<E> readValue(final Class<T> dataType); @Override @SuppressWarnings("unchecked") ListenerPromise<R> onDataChange(final Class<T> dataType); @Override ListenerPromise<R> onChildChange(final Class<T> dataType, final ChildEventType... eventsType); @Override @SuppressWarnings("unchecked") DatabaseDistribution filter(FilterType filterType, V... filterArguments); @Override DatabaseDistribution orderBy(OrderByMode orderByMode, String argument); @Override DatabaseDistribution orderBy(OrderByMode orderByMode); @Override DatabaseDistribution push(); @Override Promise<Void> removeValue(); @Override Promise<Void> updateChildren(final Map<String, Object> data); @Override @SuppressWarnings("unchecked") Promise<Void> transaction(final Class<T> dataType, final Function<R, R> transaction); @Override void setPersistenceEnabled(boolean enabled); @Override void keepSynced(boolean synced); @Override String getReferencePath(); @Override Array<Filter> getFilters(); @Override OrderByClause getOrderByClause(); @Override void terminateOperation(); }
Database implements DatabaseDistribution, QueryProvider { @Override public Promise<Void> setValue(final Object value) { checkDatabaseReference(); return FuturePromise.when(new DatabaseConsumer<FuturePromise<Void>>(this) { @Override public void accept(FuturePromise<Void> voidFuturePromise) { new QuerySetValue(Database.this, getDatabasePath()) .withArgs(value) .with(voidFuturePromise) .execute(); } }); } Database(); @Override ListenerPromise<ConnectionStatus> onConnect(); @Override DatabaseDistribution inReference(String databasePath); @Override Promise<Void> setValue(final Object value); @Override @SuppressWarnings("unchecked") Promise<E> readValue(final Class<T> dataType); @Override @SuppressWarnings("unchecked") ListenerPromise<R> onDataChange(final Class<T> dataType); @Override ListenerPromise<R> onChildChange(final Class<T> dataType, final ChildEventType... eventsType); @Override @SuppressWarnings("unchecked") DatabaseDistribution filter(FilterType filterType, V... filterArguments); @Override DatabaseDistribution orderBy(OrderByMode orderByMode, String argument); @Override DatabaseDistribution orderBy(OrderByMode orderByMode); @Override DatabaseDistribution push(); @Override Promise<Void> removeValue(); @Override Promise<Void> updateChildren(final Map<String, Object> data); @Override @SuppressWarnings("unchecked") Promise<Void> transaction(final Class<T> dataType, final Function<R, R> transaction); @Override void setPersistenceEnabled(boolean enabled); @Override void keepSynced(boolean synced); @Override String getReferencePath(); @Override Array<Filter> getFilters(); @Override OrderByClause getOrderByClause(); @Override void terminateOperation();  }