mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-12-25 22:35:35 +00:00
Added Any.toPrettyJson().
This commit is contained in:
parent
004b650762
commit
ab16c44de5
@ -52,6 +52,7 @@ class CommandLineController {
|
||||
|
||||
init {
|
||||
logger.info("CommandLineController started. App version {}", Config.APP_APPVER)
|
||||
|
||||
this.printHeader()
|
||||
if (CommandLineOptions.cmd_version) {
|
||||
System.exit(0)
|
||||
|
@ -182,7 +182,5 @@ fun String.anonymize(): String {
|
||||
return if (!CommandLineOptions.cmd_anonymize) this else this.replace(Regex("[0-9]"), "1").replace(Regex("[A-Z]"), "A").replace(Regex("[a-z]"), "a") + " (ANONYMIZED)"
|
||||
}
|
||||
|
||||
fun Any.toJson(): String {
|
||||
|
||||
return Gson().toJson(this)
|
||||
}
|
||||
fun Any.toJson(): String = Gson().toJson(this)
|
||||
fun Any.toPrettyJson(): String = GsonBuilder().setPrettyPrinting().create().toJson(this)
|
||||
|
Loading…
Reference in New Issue
Block a user