Groovy web console

subscribe to the feed Subscribe
to this


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 = ""
params.other_info = "The quick brown fox jumps over the lazy dogs"
params.deployment_contact = ""
params.someint = 1
params.afloat= 3.14

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()