Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import groovy.json.JsonSlurper
- println "java : ${System.properties['java.version']}"
- println "groovy : ${GroovySystem.version}"
- def jsonStr = """
- {
- "Id": 533,
- "StartTime": "2022-05-10 11:56:18",
- "EndTime": "2022-05-10 11:58:49",
- "TimeShift": "N/A",
- "Run": "123",
- "Setup": "Test",
- "Version": "3.17",
- "Result": "pass",
- "DebugMode": 1,
- "NumberOfCores": 3,
- }
- """
- def json = new JsonSlurper().parseText(jsonStr)
- println "json.clas = ${json.getClass()}"
- ----------------------------------------------
- OUTPUT:
- java : 17.0.2
- groovy : 3.0.9
- json.clas = class org.apache.groovy.json.internal.LazyMap
Add Comment
Please, Sign In to add comment