maximbircu/devtools-library

Add ability to get all config as JSON

Closed this issue · 0 comments

Abstract

For some library, consumers might be useful the ability to get all config info form of a JSON string.

Requirements

  • Add a getConfigAsJson method to DevToolsStorage.kt
  • Add a filterEnabled parameter so that the library user will be able to filter out the disabled configuration values.

Consumer flow

Usecase 1

  1. Go to any source Dev Tools Configuration screen
  2. Add val jsonConfiguration = devtools.getAllConfigAsJson() inside the onCreate method
  3. Place a breakpoint and check the jsonConfiguration result
  4. Make sure the JSON configuration string contains all configuration values

Usecase 2 (Make sure the filter predicate works properly)

  1. Go to any source Dev Tools Configuration screen
  2. Add val jsonConfiguration = devtools.getAllConfigAsJson { tool -> tool.isEnabled } inside the onCreate method
  3. Place a breakpoint and check the jsonConfiguration result
  4. Make sure the JSON configuration string contains all enabled configuration values
    You can try and experiment with different filters.