Class NameSpace

  • All Implemented Interfaces:

    
    public final class NameSpace
    
                        

    a facade wraps custom root directory

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final String rootDir
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID)

        Create an MMKV instance with an unique ID (in single-process mode).

        Parameters:
        mmapID - The unique ID of the MMKV instance.
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, MMKVConfig config)

        Create an MMKV instance with an unique ID (in single-process mode).

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        config - The all-in-one configuration for the MMKV instance.
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode)

        Create an MMKV instance in single-process or multi-process mode.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode, long expectedCapacity)

        Create an MMKV instance in single-process or multi-process mode.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
        expectedCapacity - The file size you expected when opening or creating file
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey)

        Create an MMKV instance in customize process mode, with an encryption key.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
        cryptKey - The encryption key of the MMKV instance (no more than 16 bytes).
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey, boolean aes256)

        Create an MMKV instance in customize process mode, with an encryption key.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
        cryptKey - The encryption key of the MMKV instance (no more than 32 bytes).
        aes256 - Use AES 256 key length.
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey, long expectedCapacity)

        Create an MMKV instance with customize settings all in one.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
        cryptKey - The encryption key of the MMKV instance (no more than 16 bytes).
        expectedCapacity - The file size you expected when opening or creating file
      • mmkvWithID

        @NonNull() MMKV mmkvWithID(String mmapID, int mode, @Nullable() String cryptKey, boolean aes256, long expectedCapacity)

        Create an MMKV instance with customize settings all in one.

        Parameters:
        mmapID - The unique ID of the MMKV instance.
        mode - The process mode of the MMKV instance, defaults to SINGLE_PROCESS_MODE.
        cryptKey - The encryption key of the MMKV instance (no more than 32 bytes).
        aes256 - Use AES 256 key length.
        expectedCapacity - The file size you expected when opening or creating file
      • backupOneToDirectory

         boolean backupOneToDirectory(String mmapID, String dstDir)

        backup one MMKV instance to dstDir

        Parameters:
        mmapID - the MMKV ID to backup
        dstDir - the backup destination directory
      • restoreOneMMKVFromDirectory

         boolean restoreOneMMKVFromDirectory(String mmapID, String srcDir)

        restore one MMKV instance from srcDir

        Parameters:
        mmapID - the MMKV ID to restore
        srcDir - the restore source directory
      • isFileValid

         boolean isFileValid(String mmapID)

        Check whether the MMKV file is valid or not. Note: Don't use this to check the existence of the instance, the result is undefined on nonexistent files.

      • removeStorage

         boolean removeStorage(String mmapID)

        remove the storage of the MMKV, including the data file &meta file (.crc) Note: the existing instance (if any) will be closed &destroyed

        Parameters:
        mmapID - The unique ID of the MMKV instance.
      • checkExist

         boolean checkExist(String mmapID)

        check existence of the MMKV file

        Parameters:
        mmapID - The unique ID of the MMKV instance.