Package 

Class PreferencesKt

    • Method Detail

      • encode

         final <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 <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
      • Preferences

         final 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 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