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