DatabaseKt

public final class DatabaseKt


Summary

Public fields

final @NonNull Flow<@NonNull ChildEvent>

Starts listening to this query's child events and emits its values via a Flow.

final @NonNull FirebaseDatabase

Returns the FirebaseDatabase instance of the default FirebaseApp.

final @NonNull Flow<@NonNull DataSnapshot>

Starts listening to this query and emits its values via a Flow.

Public methods

static final @NonNull FirebaseDatabase

Returns the FirebaseDatabase instance of the given FirebaseApp.

static final @NonNull FirebaseDatabase

Returns the FirebaseDatabase instance for the specified url.

static final @NonNull FirebaseDatabase
DatabaseKt.database(
    @NonNull Firebase receiver,
    @NonNull FirebaseApp app,
    @NonNull String url
)

Returns the FirebaseDatabase instance of the given FirebaseApp and url.

static final T
<T extends Object> DatabaseKt.getValue(@NonNull DataSnapshot receiver)

Returns the content of the DataSnapshot converted to a POJO.

static final T
<T extends Object> DatabaseKt.getValue(@NonNull MutableData receiver)

Returns the content of the MutableData converted to a POJO.

static final @NonNull Flow<T>
<T extends Object> DatabaseKt.values(@NonNull Query receiver)

Starts listening to this query and emits its values converted to a POJO via a Flow.

Public fields

childEvents

public final @NonNull Flow<@NonNull ChildEventchildEvents

Starts listening to this query's child events and emits its values via a Flow.

  • When the returned flow starts being collected, a ChildEventListener will be attached.

  • When the flow completes, the listener will be removed.

database

public final @NonNull FirebaseDatabase database

Returns the FirebaseDatabase instance of the default FirebaseApp.

snapshots

public final @NonNull Flow<@NonNull DataSnapshotsnapshots

Starts listening to this query and emits its values via a Flow.

  • When the returned flow starts being collected, a ValueEventListener will be attached.

  • When the flow completes, the listener will be removed.

Public methods

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(@NonNull Firebase receiver, @NonNull FirebaseApp app)

Returns the FirebaseDatabase instance of the given FirebaseApp.

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(@NonNull Firebase receiver, @NonNull String url)

Returns the FirebaseDatabase instance for the specified url.

DatabaseKt.database

public static final @NonNull FirebaseDatabase DatabaseKt.database(
    @NonNull Firebase receiver,
    @NonNull FirebaseApp app,
    @NonNull String url
)

Returns the FirebaseDatabase instance of the given FirebaseApp and url.

DatabaseKt.getValue

public static final T <T extends Object> DatabaseKt.getValue(@NonNull DataSnapshot receiver)

Returns the content of the DataSnapshot converted to a POJO.

Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T, and not ? extends T.

DatabaseKt.getValue

public static final T <T extends Object> DatabaseKt.getValue(@NonNull MutableData receiver)

Returns the content of the MutableData converted to a POJO.

Supports generics like List<> or Map<>. Use @JvmSuppressWildcards to force the compiler to use the type T, and not ? extends T.

DatabaseKt.values

public static final @NonNull Flow<T> <T extends Object> DatabaseKt.values(@NonNull Query receiver)

Starts listening to this query and emits its values converted to a POJO via a Flow.

  • When the returned flow starts being collected, a ValueEventListener will be attached.

  • When the flow completes, the listener will be removed.