FirebaseRemoteConfigValue

interface FirebaseRemoteConfigValue


Wrapper for a Remote Config parameter value, with methods to get it as different types.

Summary

Public functions

Boolean

Gets the value as a boolean.

ByteArray<Byte>

Gets the value as a byte[].

Double

Gets the value as a double.

Long

Gets the value as a long.

String

Gets the value as a String.

Int

Indicates at which source this value came from.

Public functions

asBoolean

fun asBoolean(): Boolean

Gets the value as a boolean.

Returns
Boolean

boolean representation of this parameter value.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

If the value cannot be converted to a boolean.

asByteArray

fun asByteArray(): ByteArray<Byte>

Gets the value as a byte[].

Returns
ByteArray<Byte>

byte[] representation of this parameter value.

asDouble

fun asDouble(): Double

Gets the value as a double.

Returns
Double

double representation of this parameter value.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

If the value cannot be converted to a double.

asLong

fun asLong(): Long

Gets the value as a long.

Returns
Long

long representation of this parameter value.

Throws
java.lang.IllegalArgumentException: java.lang.IllegalArgumentException

If the value cannot be converted to a long.

asString

fun asString(): String

Gets the value as a String.

Returns
String

String representation of this parameter value.

getSource

fun getSource(): Int

Indicates at which source this value came from.

Returns
Int

VALUE_SOURCE_REMOTE if the value was retrieved from the server, VALUE_SOURCE_DEFAULT if the value was set as a default, or VALUE_SOURCE_STATIC if no value was found and a static default value was returned instead.