|
@@ -0,0 +1,33 @@
|
|
|
+package com.ecnu.platform.test
|
|
|
+
|
|
|
+import com.ecnu.alg.pojo.path.data.AlgPathStrategyInputData
|
|
|
+import com.ecnu.alg.pojo.path.inputs.AlgBaseMap
|
|
|
+import com.ecnu.alg.pojo.path.inputs.AlgVehicle
|
|
|
+import com.three.common.utils.GsonUtil
|
|
|
+
|
|
|
+class Test {
|
|
|
+
|
|
|
+ static void main(String[] args) {
|
|
|
+ AlgBaseMap algBaseMap = new AlgBaseMap()
|
|
|
+ algBaseMap.setId("qqqq")
|
|
|
+ algBaseMap.setName("ff")
|
|
|
+ String str = GsonUtil.toJson(algBaseMap)
|
|
|
+ List<AlgBaseMap> algBaseMapList = new ArrayList<>()
|
|
|
+ algBaseMapList.add(algBaseMap)
|
|
|
+ println(str)
|
|
|
+ println(GsonUtil.toJson(algBaseMapList))
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ AlgPathStrategyInputData algPathStrategyInputData = new AlgPathStrategyInputData()
|
|
|
+ algPathStrategyInputData.setAlgBaseMap(algBaseMap)
|
|
|
+ algPathStrategyInputData.setAlgVehicleList(new ArrayList<AlgVehicle>())
|
|
|
+
|
|
|
+ println(GsonUtil.toJson(algPathStrategyInputData))
|
|
|
+
|
|
|
+ String str1 = "{\"algBaseMap\":{\"id\":\"qqqq\",\"name\":\"ff\"},\"algVehicleList\":[]}"
|
|
|
+
|
|
|
+ AlgPathStrategyInputData algPathStrategyInputData1 = GsonUtil.fromJsonObject(str1, AlgPathStrategyInputData.class)
|
|
|
+ println(algPathStrategyInputData1)
|
|
|
+ }
|
|
|
+}
|