mirror of
https://github.com/fabianonline/telegram_backup.git
synced 2024-11-22 16:56:16 +00:00
Added Any.toPrettyJson().
This commit is contained in:
parent
004b650762
commit
ab16c44de5
@ -52,6 +52,7 @@ class CommandLineController {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
logger.info("CommandLineController started. App version {}", Config.APP_APPVER)
|
logger.info("CommandLineController started. App version {}", Config.APP_APPVER)
|
||||||
|
|
||||||
this.printHeader()
|
this.printHeader()
|
||||||
if (CommandLineOptions.cmd_version) {
|
if (CommandLineOptions.cmd_version) {
|
||||||
System.exit(0)
|
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)"
|
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 {
|
fun Any.toJson(): String = Gson().toJson(this)
|
||||||
|
fun Any.toPrettyJson(): String = GsonBuilder().setPrettyPrinting().create().toJson(this)
|
||||||
return Gson().toJson(this)
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user