Class TypedPreferenceKey<T>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TypedPreferenceKey​(java.lang.String id, java.lang.String defaultValue)
      Constructor that uses the internal representation of the default value.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract java.lang.String toString​(T value)
      Convert the given value to its string representation.
      abstract T toValue​(java.lang.String string)
      Convert the given string to its type-safe value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • TypedPreferenceKey

        protected TypedPreferenceKey​(java.lang.String id,
                                     java.lang.String defaultValue)
        Constructor that uses the internal representation of the default value. Concrete implementations are expected to offer a constructor with a type-safe default value.
    • Method Detail

      • toString

        public abstract java.lang.String toString​(T value)
        Convert the given value to its string representation. A null value is converted to a null string.
      • toValue

        public abstract T toValue​(java.lang.String string)
        Convert the given string to its type-safe value. The null string is converted to the null value.
        Throws:
        java.lang.IllegalArgumentException - if the given string is not a valid representation.