Package 

Class PreferencesKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> Unit encode(Preferences $self, String tag, T value) Serializes and encodes the given value into the SharedPreferences at the specified tag using serializer retrieved from the reified type parameter.
      final static <T extends Any> T decode(Preferences $self, String tag) Decodes and deserializes from the SharedPreferences at the specified tag to the value of type T using deserializer retrieved from the reified type parameter.
      final static <T extends Any> T decodeOrDefault(Preferences $self, String tag, T default) Decodes and deserializes from the SharedPreferences at the specified tag to the value of type T using deserializer retrieved from the reified type parameter.
      final static Preferences Preferences(SharedPreferences sharedPreferences, Function1<PreferencesBuilder, Unit> builderAction) Creates an instance of Preferences encoding and decoding data from the given SharedPreferences and adjusted with builderAction.
      final static Preferences Preferences(Preferences preferences, Function1<PreferencesBuilder, Unit> builderAction) Creates an instance of Preferences using the configuration of the previous created Preferences and adjusted with builderAction.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • encode

         final static <T extends Any> Unit encode(Preferences $self, String tag, T value)

        Serializes and encodes the given value into the SharedPreferences at the specified tag using serializer retrieved from the reified type parameter.

        Parameters:
        tag - key to encode data to
        value - value to encode
      • decode

         final static <T extends Any> T decode(Preferences $self, String tag)

        Decodes and deserializes from the SharedPreferences at the specified tag to the value of type T using deserializer retrieved from the reified type parameter.

        Parameters:
        tag - key to decode data from
      • decodeOrDefault

         final static <T extends Any> T decodeOrDefault(Preferences $self, String tag, T default)

        Decodes and deserializes from the SharedPreferences at the specified tag to the value of type T using deserializer retrieved from the reified type parameter.

        Parameters:
        tag - key to decode data from
        default - default value, if no object was encoded at tag
      • Preferences

         final static Preferences Preferences(SharedPreferences sharedPreferences, Function1<PreferencesBuilder, Unit> builderAction)

        Creates an instance of Preferences encoding and decoding data from the given SharedPreferences and adjusted with builderAction.

        Parameters:
        sharedPreferences - the storage to encode data into and decode data from
        builderAction - builder to change the behavior of the Preferences format
      • Preferences

         final static Preferences Preferences(Preferences preferences, Function1<PreferencesBuilder, Unit> builderAction)

        Creates an instance of Preferences using the configuration of the previous created Preferences and adjusted with builderAction.

        Parameters:
        preferences - format to copy the configuration from
        builderAction - builder to change the behavior of the Preferences format