DatabaseKt

public final classDatabaseKt


Summary

Public fields

final @NonNullFlow<@NonNullChildEvent>

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

final @NonNullFirebaseDatabase

Returns theFirebaseDatabase instance of the defaultFirebaseApp.

final @NonNullFlow<@NonNullDataSnapshot>

Starts listening to this query and emits its values via aFlow.

Public methods

static final @NonNullFirebaseDatabase

Returns theFirebaseDatabase instance of the givenFirebaseApp.

static final @NonNullFirebaseDatabase

Returns theFirebaseDatabase instance for the specifiedurl.

static final @NonNullFirebaseDatabase
DatabaseKt.database(
    @NonNullFirebase receiver,
    @NonNullFirebaseApp app,
    @NonNullString url
)

Returns theFirebaseDatabase instance of the givenFirebaseApp andurl.

static final T

Returns the content of the DataSnapshot converted to a POJO.

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

Returns the content of the MutableData converted to a POJO.

static final @NonNullFlow<T>
<T extends Object>DatabaseKt.values(@NonNullQuery receiver)

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

Public fields

childEvents

public final @NonNullFlow<@NonNullChildEventchildEvents

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

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

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

database

public final @NonNullFirebaseDatabase database

Returns theFirebaseDatabase instance of the defaultFirebaseApp.

snapshots

public final @NonNullFlow<@NonNullDataSnapshotsnapshots

Starts listening to this query and emits its values via aFlow.

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

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

Public methods

DatabaseKt.database

public static final @NonNullFirebaseDatabase DatabaseKt.database(@NonNullFirebase receiver, @NonNullFirebaseApp app)

Returns theFirebaseDatabase instance of the givenFirebaseApp.

DatabaseKt.database

public static final @NonNullFirebaseDatabase DatabaseKt.database(@NonNullFirebase receiver, @NonNullString url)

Returns theFirebaseDatabase instance for the specifiedurl.

DatabaseKt.database

public static final @NonNullFirebaseDatabase DatabaseKt.database(
    @NonNullFirebase receiver,
    @NonNullFirebaseApp app,
    @NonNullString url
)

Returns theFirebaseDatabase instance of the givenFirebaseApp andurl.

DatabaseKt.getValue

public static final T <T extends Object>DatabaseKt.getValue(@NonNullDataSnapshot 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 typeT, and not? extends T.

DatabaseKt.getValue

public static final T <T extends Object>DatabaseKt.getValue(@NonNullMutableData 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 typeT, and not? extends T.

DatabaseKt.values

public static final @NonNullFlow<T> <T extends Object>DatabaseKt.values(@NonNullQuery receiver)

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

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

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.