Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 1 month ago by Anonymous
Actions Execute script  ▶ Edit in console Back to console Show/hide line numbers View recent scripts
params = [:]

params.resource_contact = "testing@example.com"
params.other_info = "The quick brown fox jumps over the lazy dogs"
params.deployment_contact = "deployer@example.com"
params.someint = 1
params.afloat= 3.14
params.innerdict=["innerkey":"innervalue"]

println "Not pretty, not sorted:"
println "${params}"

import static groovy.json.JsonOutput.*
println ""
println "Pretty but not sorted:"
println prettyPrint(toJson(params))
println ""
println "Pretty AND sorted:"

print prettyPrint(toJson(params.sort()))

println ""
println "With INSPECT:"
println params.inspect()