[[7080393202758320385,"RB01Ps012306300001","C","2023-06-30T11:54:46","730940","2023-06-30T11:54:46","2023-06-30T11:54:46","",738414,715950,"2023-06-30T00:00:00",268.0000000000,268.0000000000,737827,"EQLZ 1100","23FQ11084410",0,10101,10101,0,1.0000000000,1.0000000000,268.0000000000,268.0000000000,100.0000000000,0.0,"0"],[7080393733975310593,"RB01Ps012306300002","C","2023-06-30T11:56:53","730940","2023-06-30T11:56:53","2023-06-30T11:56:53","",738414,715950,"2023-06-30T00:00:00",-268.0000000000,-268.0000000000,737827,"EQLZ 1100","23FQ11084410",0,10101,10101,0,-1.0000000000,-1.0000000000,-268.0000000000,-268.0000000000,100.0000000000,0.0,"0"],[7080751531783356673,"RB01Ps012307010001","C","2023-07-01T11:38:39","730940","2023-07-01T11:38:39","2023-07-01T11:38:39","",738414,715950,"2023-07-01T00:00:00",388.0000000000,288.0000000000,735857,"EQUALIZER 官方 FAULT LESS低帮\"无鞋带\" \"一脚蹬\"反硫化错版鞋 原创帆布鞋板鞋男女运动艹 无中生有","22FSFSL00405",0,10101,10101,0,1.0000000000,1.0000000000,388.0000000000,288.0000000000,74.2268040000,0.0,"0"],[7080756229642912001,"RB01Ps012307010002","C","2023-07-01T11:57:19","730940","2023-07-01T11:57:19","2023-07-01T11:57:19","",738414,715950,"2023-07-01T00:00:00",328.0000000000,328.0000000000,737124,"EQLZ 梭织长裤","23ASLPNW401BL00",0,10101,10101,0,1.0000000000,1.0000000000,328.0000000000,328.0000000000,100.0000000000,0.0,"0"],[7080771963471266049,"RB01Ps012307010003","C","2023-07-01T12:59:50","730940","2023-07-01T12:59:50","2023-07-01T12:59:50","",738414,715950,"2023-07-01T00:00:00",604.0000000000,604.0000000000,737044,"EQLZ 针织复古窄肩背心","23ASJS0KK04OXS0",0,10101,10101,0,1.0000000000,1.0000000000,168.0000000000,168.0000000000,100.0000000000,0.0,"0"],[7080771963471266049,"RB01Ps012307010003","C","2023-07-01T12:59:50","730940","2023-07-01T12:59:50","2023-07-01T12:59:50","",738414,715950,"2023-07-01T00:00:00",604.0000000000,604.0000000000,737041,"EQLZ 针织复古窄肩背心","23ASJS0KK04OM00",0,10101,10101,0,1.0000000000,1.0000000000,168.0000000000,168.0000000000,100.0000000000,0.0,"0"],[7080771963471266049,"RB01Ps012307010003","C","2023-07-01T12:59:50","730940","2023-07-01T12:59:50","2023-07-01T12:59:50","",738414,715950,"2023-07-01T00:00:00",604.0000000000,604.0000000000,737753,"EQLZ 1100","23FQ11010420",0,10101,10101,0,1.0000000000,1.0000000000,268.0000000000,268.0000000000,100.0000000000,0.0,"0"]]通过gson().fromjson转换成对象
时间: 2023-07-21 17:10:05 浏览: 166
vite-plugin-full-reload::recycling_symbol:修改文件后自动重新加载页面
要将JSON字符串转换为对象,你需要定义一个相应的Java类来表示这个对象的结构。根据你提供的JSON字符串,它包含一个二维数组,每个子数组表示一个对象。以下是一个示例的Java类定义:
```java
import com.google.gson.Gson;
public class Main {
public static class MyObject {
private long id;
private String code;
private String type;
private String timestamp1;
private String field1;
private String timestamp2;
private String timestamp3;
private String field2;
private int field3;
private int field4;
private String timestamp4;
private double field5;
private double field6;
private int field7;
private String field8;
private String field9;
private int field10;
private int field11;
private int field12;
private int field13;
private double field14;
private double field15;
private double field16;
private double field17;
private double field18;
private double field19;
private double field20;
public long getId() {
return id;
}
public String getCode() {
return code;
}
public String getType() {
return type;
}
public String getTimestamp1() {
return timestamp1;
}
public String getField1() {
return field1;
}
public String getTimestamp2() {
return timestamp2;
}
public String getTimestamp3() {
return timestamp3;
}
public String getField2() {
return field2;
}
public int getField3() {
return field3;
}
public int getField4() {
return field4;
}
public String getTimestamp4() {
return timestamp4;
}
public double getField5() {
return field5;
}
public double getField6() {
return field6;
}
public int getField7() {
return field7;
}
public String getField8() {
return field8;
}
public String getField9() {
return field9;
}
public int getField10() {
return field10;
}
public int getField11() {
return field11;
}
public int getField12() {
return field12;
}
public int getField13() {
return field13;
}
public double getField14() {
return field14;
}
public double getField15() {
return field15;
}
public double getField16() {
return field16;
}
public double getField17() {
return field17;
}
public double getField18() {
return field18;
}
public double getField19() {
return field19;
}
public double getField20() {
return field20;
}
}
public static void main(String[] args) {
String json = "[[7080393202758320385,\"RB01Ps012306300001\",\"C\",\"2023-06-30T11:54:46\",\"730940\",\"2023-06-30T11:54:46\",\"2023-06-30T11:54:46\",\"\",738414,715950,\"2023-06-30T00:00:00\",268.0000000000,268.0000000000,737827,\"EQLZ 1100\",\"23FQ11084410\",0,10101,10101,0,1.0000000000,1.0000000000,268.0000000000,268.0000000000,100.0000000000,0.0,\"0\"],[7080393733975310593,\"RB01Ps012306300002\",\"C\",\"2023-06-30T11:56:53\",\"730940\",\"2023-06-30T11:56:53\",\"2023-06-30T11:56:53\",\"\",738414,715950,\"2023-06-30T00:00:00\",-268.0000000000,-268.0000000000,737827,\"EQLZ 1100\",\"23FQ11084410\",0,10101,10101,0,-1.0000000000,-1.0000000000,-268.0000000000,-268.0000000000,100.0000000000,0.0,\"0\"],[7080751531783356673,\"RB01Ps012307010001\",\"C\",\"2023-07-01T11:38:39\",\"730940\",\"2023-07-01T11:38:39\",\"2023-07-01T11:38:39\",\"\",738414,715950,\"2023-07-01T00:00:00\",388.0000000000,***
阅读全文