Package com.medm.devicekit
Class DeviceSetting
java.lang.Object
com.medm.devicekit.DeviceSetting
- All Implemented Interfaces:
 android.os.Parcelable
Represents setting as its kind and fixed array of possible string values.
 You can get current selected value by using 
getValue() or getValueIndex() and set value by using selectValueWithIndex(int)}- 
Nested Class Summary
Nested Classes - 
Field Summary
FieldsFields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE - 
Method Summary
Modifier and TypeMethodDescriptionintgetKind()Get device setting kindString[]Get possible device setting variants.getValue()Get current device setting valueintGet current setting value position ingetPossibleValues()arraybooleanIs this setting readonly, usually means that you can set this setting only before adding.voidselectValueWithIndex(int index) Select variant fromgetPossibleValues()arrayvoidSet setting valuevoidwriteToParcel(android.os.Parcel parcel, int i)  
- 
Field Details
- 
CREATOR
 
 - 
 - 
Method Details
- 
getKind
Get device setting kind- Returns:
 - kind of the setting
 
 - 
getPossibleValues
Get possible device setting variants. The array is fixed for the specific setting instance.- Returns:
 - possible variants represented as strings
 
 - 
getValueIndex
public int getValueIndex()Get current setting value position ingetPossibleValues()array- Returns:
 - position of value in 
getPossibleValues()array 
 - 
selectValueWithIndex
public void selectValueWithIndex(int index) Select variant fromgetPossibleValues()array- Parameters:
 index- index ingetPossibleValues()array- Throws:
 UnsupportedOperationException- ifisReadonly()or if its kind isDeviceSetting.Kind.EncryptionKeyIllegalArgumentException- if provided index is out of bounds
 - 
getValue
Get current device setting value- Returns:
 - string representation of the currently selected value
 
 - 
setValue
Set setting value- Parameters:
 value- string representation of the new value. For all settings apart fromDeviceSetting.Kind.EncryptionKeyshould be one ofgetPossibleValues()- Throws:
 UnsupportedOperationException- ifisReadonly()IllegalArgumentException- if provided value isn't ingetPossibleValues()
 - 
isReadonly
public boolean isReadonly()Is this setting readonly, usually means that you can set this setting only before adding. If true callingselectValueWithIndex(int)would result in exception.- Returns:
 - is readonly
 
 - 
describeContents
public int describeContents()- Specified by:
 describeContentsin interfaceandroid.os.Parcelable
 - 
writeToParcel
public void writeToParcel(android.os.Parcel parcel, int i) - Specified by:
 writeToParcelin interfaceandroid.os.Parcelable
 
 -