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.date= new Date()
params.innerdict=["innerkey":"innervalue", 3:"the-number-three"]

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:"
params.sort
println params.inspect()

def i=params.inspect()
println ""
println "i:(" + i + ")"

//def reeval=Eval.me(i)
//println ""
//println "reeval:(" + reeval + ")"