Add ability to get all config as JSON
Closed this issue · 0 comments
maximbircu commented
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
- Go to any source Dev Tools Configuration screen
- Add
val jsonConfiguration = devtools.getAllConfigAsJson()
inside theonCreate
method - Place a breakpoint and check the
jsonConfiguration
result - Make sure the JSON configuration string contains all configuration values
Usecase 2 (Make sure the filter predicate works properly)
- Go to any source Dev Tools Configuration screen
- Add
val jsonConfiguration = devtools.getAllConfigAsJson { tool -> tool.isEnabled }
inside theonCreate
method - Place a breakpoint and check the
jsonConfiguration
result - Make sure the JSON configuration string contains all enabled configuration values
You can try and experiment with different filters.