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 |
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 |
|---|
Fields | |
|---|---|
public
static
final
Creator<SettingsPreferenceValue> |
CREATOR
Parcelable Creator for |
Public methods | |
|---|---|
boolean
|
getBooleanValue()
Returns the boolean value for Preference, the type must be |
double
|
getDoubleValue()
Returns the double value for Preference, the type must be |
int
|
getIntValue()
Returns the int value for Preference, the type must be |
long
|
getLongValue()
Returns the long value for Preference, the type must be |
String
|
getStringValue()
Returns the string value for Preference, the type must be |
int
|
getType()
Returns the type indicator for Preference value. |
Inherited methods | |
|---|---|
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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-03-13 UTC.