FirebaseRemoteConfigValue

public interface FirebaseRemoteConfigValue


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

Summary

Public methods

abstract boolean

Gets the value as a boolean.

abstract @NonNull byte[]

Gets the value as a byte[].

abstract double

Gets the value as a double.

abstract long

Gets the value as a long.

abstract @NonNull String

Gets the value as a String.

abstract int

Indicates at which source this value came from.

Public methods

asBoolean

abstract boolean asBoolean()

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

abstract @NonNull byte[] asByteArray()

Gets the value as a byte[].

Returns
@NonNull byte[]

byte[] representation of this parameter value.

asDouble

abstract double asDouble()

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

abstract long asLong()

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

abstract @NonNull String asString()

Gets the value as a String.

Returns
@NonNull String

String representation of this parameter value.

getSource

abstract int getSource()

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.