SettingsPreferenceValue


public final class SettingsPreferenceValue
extends Object implements Parcelable

java.lang.Object
   ↳ android.service.settings.preferences.SettingsPreferenceValue


This objects represents a value that can be used for a particular settings preference.

The data type for the value will correspond to getType(). For possible types, see constants below, such as TYPE_BOOLEAN and TYPE_STRING. Depending on the type, the corresponding getter will contain its value.

See documentation on the constants for which getter method should be used.

Summary

Nested classes

class SettingsPreferenceValue.Builder

Builder to construct SettingsPreferenceValue

Constants

int TYPE_BOOLEAN

Value is of type boolean.

int TYPE_DOUBLE

Value is of type double.

int TYPE_INT

Value is of type int.

int TYPE_LONG

Value is of type long.

int TYPE_STRING

Value is of type string.

Inherited constants

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".

Fields

public static final Creator<SettingsPreferenceValue> CREATOR

Parcelable Creator for SettingsPreferenceValue.

Public methods

boolean getBooleanValue()

Returns the boolean value for Preference, the type must be TYPE_BOOLEAN.

double getDoubleValue()

Returns the double value for Preference, the type must be TYPE_DOUBLE.

int getIntValue()

Returns the int value for Preference, the type must be TYPE_INT.

long getLongValue()

Returns the long value for Preference, the type must be TYPE_LONG.

String getStringValue()

Returns the string value for Preference, the type must be TYPE_STRING.

int getType()

Returns the type indicator for Preference value.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

abstract int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Constants

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN

Value is of type boolean. Access via getBooleanValue().

Constant Value: 0 (0x00000000)

TYPE_DOUBLE

public static final int TYPE_DOUBLE

Value is of type double. Access via getDoubleValue().

Constant Value: 2 (0x00000002)

TYPE_INT

public static final int TYPE_INT

Value is of type int. Access via getIntValue().

Constant Value: 4 (0x00000004)

TYPE_LONG

public static final int TYPE_LONG

Value is of type long. Access via getLongValue().

Constant Value: 1 (0x00000001)

TYPE_STRING

public static final int TYPE_STRING

Value is of type string. Access via getStringValue().

Constant Value: 3 (0x00000003)

Fields

CREATOR

public static final Creator<SettingsPreferenceValue> CREATOR

Parcelable Creator for SettingsPreferenceValue.

Public methods

getBooleanValue

public boolean getBooleanValue ()

Returns the boolean value for Preference, the type must be TYPE_BOOLEAN.

Returns
boolean

getDoubleValue

public double getDoubleValue ()

Returns the double value for Preference, the type must be TYPE_DOUBLE.

Returns
double

getIntValue

public int getIntValue ()

Returns the int value for Preference, the type must be TYPE_INT.

Returns
int

getLongValue

public long getLongValue ()

Returns the long value for Preference, the type must be TYPE_LONG.

Returns
long

getStringValue

public String getStringValue ()

Returns the string value for Preference, the type must be TYPE_STRING.

Returns
String

getType

public int getType ()

Returns the type indicator for Preference value.

Returns
int Value is TYPE_BOOLEAN, TYPE_LONG, TYPE_DOUBLE, TYPE_STRING, or TYPE_INT