Add a JSON object passing mechanism
This commit is contained in:
parent
037f00fab6
commit
2f65f299fb
1 changed files with 6 additions and 6 deletions
|
|
@ -1,22 +1,22 @@
|
|||
def sominfo = null
|
||||
def sominfostore = null
|
||||
|
||||
def String asJsonText() {
|
||||
return writeJSON(returnText: true, json: sominfo, pretty: 1)
|
||||
return writeJSON(returnText: true, json: sominfostore, pretty: 1)
|
||||
}
|
||||
|
||||
def boolean isSet() {
|
||||
return (sominfo != null)
|
||||
return (sominfostore != null)
|
||||
}
|
||||
|
||||
def set(String jsontext) {
|
||||
sominfo = readJSON(text: jsontext)
|
||||
sominfostore = readJSON(text: jsontext)
|
||||
|
||||
def som_support_json_text = writeJSON(returnText: true, json: sominfo, pretty: 1)
|
||||
def som_support_json_text = writeJSON(returnText: true, json: sominfostore, pretty: 1)
|
||||
echo "Som support info:\n${asJsonText()}"
|
||||
}
|
||||
|
||||
def get() {
|
||||
return sominfo
|
||||
return sominfostore
|
||||
}
|
||||
|
||||
return this
|
||||
Loading…
Add table
Add a link
Reference in a new issue