Class DeviceSetting

  • All Implemented Interfaces:
    android.os.Parcelable

    public class DeviceSetting
    extends java.lang.Object
    implements 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 
      Modifier and Type Class Description
      static class  DeviceSetting.Kind  
      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static android.os.Parcelable.Creator<DeviceSetting> CREATOR  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Field Detail

      • CREATOR

        public static final android.os.Parcelable.Creator<DeviceSetting> CREATOR
    • Method Detail

      • getKind

        public DeviceSetting.Kind getKind()
        Get device setting kind
        Returns:
        kind of the setting
      • getPossibleValues

        public java.lang.String[] getPossibleValues()
        Get possible device setting variants. The array is fixed for the specific setting instance.
        Returns:
        possible variants represented as strings
      • selectValueWithIndex

        public void selectValueWithIndex​(int index)
        Select variant from getPossibleValues() array
        Parameters:
        index - index in getPossibleValues() array
        Throws:
        java.lang.UnsupportedOperationException - if isReadonly()
        java.lang.IllegalArgumentException - if provided index is out of bounds
      • getValue

        public java.lang.String getValue()
        Get current device setting value
        Returns:
        string representation of the currently selected value
      • isReadonly

        public boolean isReadonly()
        Is this setting readonly, usually means that you can set this setting only before adding. If true calling selectValueWithIndex(int) would result in exception.
        Returns:
        is readonly
      • describeContents

        public int describeContents()
        Specified by:
        describeContents in interface android.os.Parcelable
      • writeToParcel

        public void writeToParcel​(android.os.Parcel parcel,
                                  int i)
        Specified by:
        writeToParcel in interface android.os.Parcelable