|
@@ -4,6 +4,9 @@ import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.persagy.ibms.data.sdk.util.FastJsonUtil;
|
|
|
+
|
|
|
public class SceneDataSet {
|
|
|
public boolean isSingleValueSet = false;
|
|
|
public List<SceneDataObject> set;
|
|
@@ -45,4 +48,24 @@ public class SceneDataSet {
|
|
|
public boolean hasColChange(String col) {
|
|
|
return this.change.colChangeMap.containsKey(col);
|
|
|
}
|
|
|
+
|
|
|
+ public JSONArray toJSON(int depth) {
|
|
|
+ JSONArray result = new JSONArray();
|
|
|
+ if (this.isSingleValueSet) {
|
|
|
+ for (int i = 0; i < this.singleValueSet.size(); i++) {
|
|
|
+ result.add(this.singleValueSet.get(i).value_prim.value);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ for (int i = 0; i < this.set.size(); i++) {
|
|
|
+ SceneDataObject sod = this.set.get(i);
|
|
|
+ result.add(sod.toJSON(depth));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ return FastJsonUtil.toString(this.toJSON(1));
|
|
|
+ }
|
|
|
}
|