Java 为什么我';m获得预期的begin_数组,但为字符串
这是我的json数据Java 为什么我';m获得预期的begin_数组,但为字符串,java,android,Java,Android,这是我的json数据 { "Success": true, "Message": "User Not Found", "Customer_Data": "", "Customer_Device": "", "Customer_Event": "", "All_Event": [ { "event_id": 6, "event_name": "Test Event - 1",
{
"Success": true,
"Message": "User Not Found",
"Customer_Data": "",
"Customer_Device": "",
"Customer_Event": "",
"All_Event": [
{
"event_id": 6,
"event_name": "Test Event - 1",
"start_date": "01/06/2019",
"end_date": "01/06/2019",
"address_1": "Mumbai",
"address_2": "Mumbai",
"location_link": "https://goo.gl/maps/vTia6DQxwmiA5kvz6",
"pincode": 400060,
"state_id": 10,
"city_id": 355,
"sechudel": "Test",
"itinerary": "Test",
"edate": "2019-05-09T17:00:05.95592",
"eventimg": "http://zaidicorp.in/login/ProcessImage/636935218388448729.png"
}
],
"Status": 1,
"Currentdate": "5/16/2019 11:40:54 AM"
}
这是我的pojo文件
package mytraining.com.mytraining.Pojo;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
import java.util.List;
public class OtpCheck implements Serializable {
@SerializedName("Success")
@Expose
private Boolean success;
@SerializedName("Message")
@Expose
private String message;
@SerializedName("Customer_Data")
@Expose
private List<CustomerData> customerData;
@SerializedName("Customer_Device")
@Expose
private List<CustomerDevice> customerDevice;
@SerializedName("Customer_Event")
@Expose
private List<CustomerEvent> customerEvent;
@SerializedName("Event")
@Expose
private List<EventDetail> eventDetails;
@SerializedName("Status")
@Expose
private Integer status;
@SerializedName("Currentdate")
@Expose
private String currentdate;
public List<EventDetail> getEventDetails() {
return eventDetails;
}
public void setEventDetails(List<EventDetail> eventDetails) {
this.eventDetails = eventDetails;
}
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public List<CustomerData> getCustomerData() {
return customerData;
}
public void setCustomerData(List<CustomerData> customerData) {
this.customerData = customerData;
}
public List<CustomerDevice> getCustomerDevice() {
return customerDevice;
}
public void setCustomerDevice(List<CustomerDevice> customerDevice) {
this.customerDevice = customerDevice;
}
public List<CustomerEvent> getCustomerEvent() {
return customerEvent;
}
public void setCustomerEvent(List<CustomerEvent> customerEvent) {
this.customerEvent = customerEvent;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getCurrentdate() {
return currentdate;
}
public void setCurrentdate(String currentdate) {
this.currentdate = currentdate;
}
/**
* Inner Class For Customer Data
*/
public static class CustomerData implements Serializable {
@SerializedName("cust_id")
@Expose
private Integer custId;
@SerializedName("cust_email")
@Expose
private String custEmail;
@SerializedName("customername")
@Expose
private String customername;
@SerializedName("personalcontact")
@Expose
private String personalcontact;
public Integer getCustId() {
return custId;
}
public void setCustId(Integer custId) {
this.custId = custId;
}
public String getCustEmail() {
return custEmail;
}
public void setCustEmail(String custEmail) {
this.custEmail = custEmail;
}
public String getCustomername() {
return customername;
}
public void setCustomername(String customername) {
this.customername = customername;
}
public String getPersonalcontact() {
return personalcontact;
}
public void setPersonalcontact(String personalcontact) {
this.personalcontact = personalcontact;
}
}
/**
* Inner Class For Customer Device
*/
public static class CustomerDevice implements Serializable {
@SerializedName("cust_id")
@Expose
private Integer custId;
@SerializedName("Cust_device")
@Expose
private String custDevice;
@SerializedName("bg_device_Brand")
@Expose
private String bgDeviceBrand;
@SerializedName("bg_device_model")
@Expose
private String bgDeviceModel;
@SerializedName("android_ver")
@Expose
private String androidVer;
@SerializedName("device_mac")
@Expose
private String deviceMac;
@SerializedName("opt")
@Expose
private Object opt;
public Integer getCustId() {
return custId;
}
public void setCustId(Integer custId) {
this.custId = custId;
}
public String getCustDevice() {
return custDevice;
}
public void setCustDevice(String custDevice) {
this.custDevice = custDevice;
}
public String getBgDeviceBrand() {
return bgDeviceBrand;
}
public void setBgDeviceBrand(String bgDeviceBrand) {
this.bgDeviceBrand = bgDeviceBrand;
}
public String getBgDeviceModel() {
return bgDeviceModel;
}
public void setBgDeviceModel(String bgDeviceModel) {
this.bgDeviceModel = bgDeviceModel;
}
public String getAndroidVer() {
return androidVer;
}
public void setAndroidVer(String androidVer) {
this.androidVer = androidVer;
}
public String getDeviceMac() {
return deviceMac;
}
public void setDeviceMac(String deviceMac) {
this.deviceMac = deviceMac;
}
public Object getOpt() {
return opt;
}
public void setOpt(Object opt) {
this.opt = opt;
}
}
/**
* Inner Class For Customer Event
*/
public static class CustomerEvent implements Serializable {
@SerializedName("ticket_no")
@Expose
private String ticketNo;
@SerializedName("seat_no")
@Expose
private String seatNo;
@SerializedName("event_name")
@Expose
private String eventName;
@SerializedName("start_date")
@Expose
private String startDate;
@SerializedName("end_date")
@Expose
private String endDate;
@SerializedName("location_link")
@Expose
private String locationLink;
@SerializedName("edate")
@Expose
private String edate;
public String getTicketNo() {
return ticketNo;
}
public void setTicketNo(String ticketNo) {
this.ticketNo = ticketNo;
}
public String getSeatNo() {
return seatNo;
}
public void setSeatNo(String seatNo) {
this.seatNo = seatNo;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getLocationLink() {
return locationLink;
}
public void setLocationLink(String locationLink) {
this.locationLink = locationLink;
}
public String getEdate() {
return edate;
}
public void setEdate(String edate) {
this.edate = edate;
}
}
/**
* Inner Class For Event Detail
*/
public static class EventDetail implements Serializable {
@SerializedName("event_id")
@Expose
private Integer eventId;
@SerializedName("event_name")
@Expose
private String eventName;
@SerializedName("start_date")
@Expose
private String startDate;
@SerializedName("end_date")
@Expose
private String endDate;
@SerializedName("address_1")
@Expose
private String address1;
@SerializedName("address_2")
@Expose
private String address2;
@SerializedName("location_link")
@Expose
private String locationLink;
@SerializedName("pincode")
@Expose
private Integer pincode;
@SerializedName("state_id")
@Expose
private Integer stateId;
@SerializedName("city_id")
@Expose
private Integer cityId;
@SerializedName("sechudel")
@Expose
private String sechudel;
@SerializedName("itinerary")
@Expose
private String itinerary;
@SerializedName("edate")
@Expose
private String edate;
@SerializedName("eventimg")
@Expose
private String eventimg;
public Integer getEventId() {
return eventId;
}
public void setEventId(Integer eventId) {
this.eventId = eventId;
}
public String getEventName() {
return eventName;
}
public void setEventName(String eventName) {
this.eventName = eventName;
}
public String getStartDate() {
return startDate;
}
public void setStartDate(String startDate) {
this.startDate = startDate;
}
public String getEndDate() {
return endDate;
}
public void setEndDate(String endDate) {
this.endDate = endDate;
}
public String getAddress1() {
return address1;
}
public void setAddress1(String address1) {
this.address1 = address1;
}
public String getAddress2() {
return address2;
}
public void setAddress2(String address2) {
this.address2 = address2;
}
public String getLocationLink() {
return locationLink;
}
public void setLocationLink(String locationLink) {
this.locationLink = locationLink;
}
public Integer getPincode() {
return pincode;
}
public void setPincode(Integer pincode) {
this.pincode = pincode;
}
public Integer getStateId() {
return stateId;
}
public void setStateId(Integer stateId) {
this.stateId = stateId;
}
public Integer getCityId() {
return cityId;
}
public void setCityId(Integer cityId) {
this.cityId = cityId;
}
public String getSechudel() {
return sechudel;
}
public void setSechudel(String sechudel) {
this.sechudel = sechudel;
}
public String getItinerary() {
return itinerary;
}
public void setItinerary(String itinerary) {
this.itinerary = itinerary;
}
public String getEdate() {
return edate;
}
public void setEdate(String edate) {
this.edate = edate;
}
public String getEventimg() {
return eventimg;
}
public void setEventimg(String eventimg) {
this.eventimg = eventimg;
}
}
}
包mytraining.com.mytraining.Pojo;
导入com.google.gson.annotations.Expose;
导入com.google.gson.annotations.SerializedName;
导入java.io.Serializable;
导入java.util.List;
公共类OtpCheck实现可序列化{
@序列化名称(“成功”)
@暴露
私人布尔成功;
@SerializedName(“消息”)
@暴露
私有字符串消息;
@SerializedName(“客户数据”)
@暴露
私有列表客户数据;
@SerializedName(“客户设备”)
@暴露
私有列表客户设备;
@SerializedName(“客户事件”)
@暴露
私人名单客户事件;
@序列化名称(“事件”)
@暴露
私人名单详情;
@序列化名称(“状态”)
@暴露
私有整数状态;
@SerializedName(“当前日期”)
@暴露
私有字符串currentdate;
公共列表getEventDetails(){
返回事件详细信息;
}
public void setEventDetails(列出eventDetails){
this.eventDetails=eventDetails;
}
公共布尔getSuccess(){
回归成功;
}
public void setSuccess(布尔值成功){
成功=成功;
}
公共字符串getMessage(){
返回消息;
}
公共无效设置消息(字符串消息){
this.message=消息;
}
公共列表getCustomerData(){
返回客户数据;
}
公共无效setCustomerData(列出customerData){
this.customerData=customerData;
}
公共列表getCustomerDevice(){
返回客户设备;
}
public void setCustomerDevice(列出customerDevice){
this.customerDevice=customerDevice;
}
公共列表getCustomerEvent(){
返回客户事件;
}
public void setCustomerEvent(列出customerEvent){
this.customerEvent=customerEvent;
}
公共整数getStatus(){
返回状态;
}
公共void setStatus(整数状态){
这个状态=状态;
}
公共字符串getCurrentdate(){
返回当前日期;
}
公共无效setCurrentdate(字符串currentdate){
this.currentdate=currentdate;
}
/**
*客户数据的内部类
*/
公共静态类CustomerData实现可序列化{
@序列化名称(“客户id”)
@暴露
私有整数custId;
@SerializedName(“客户电子邮件”)
@暴露
私人电子邮件;
@序列化名称(“客户名称”)
@暴露
私有字符串客户名称;
@SerializedName(“个人联系人”)
@暴露
私人联络;
公共整数getCustId(){
返回客户ID;
}
public void setCustId(整数custId){
this.custId=custId;
}
公共字符串getCustEmail(){
回复电子邮件;
}
public void setCustEmail(字符串custEmail){
this.custEmail=custEmail;
}
公共字符串getCustomername(){
返回客户名称;
}
public void setCustomername(字符串customername){
this.customername=客户名称;
}
公共字符串getPersonalcontact(){
回复个人联系方式;
}
public void setPersonalcontact(字符串personalcontact){
this.personalcontact=personalcontact;
}
}
/**
*客户设备的内部类
*/
公共静态类CustomerDevice实现可序列化{
@序列化名称(“客户id”)
@暴露
私有整数custId;
@序列化名称(“客户设备”)
@暴露
专用字符串存储设备;
@序列化名称(“bg\U设备\U品牌”)
@暴露
私人品牌;
@SerializedName(“bg\U设备\U型号”)
@暴露
私有字符串bgDeviceModel;
@SerializedName(“安卓版本”)
@暴露
私有字符串androidVer;
@SerializedName(“设备\u mac”)
@暴露
专用字符串设备;
@序列化名称(“opt”)
@暴露
私有对象选择;
公共整数getCustId(){
返回客户ID;
}
public void setCustId(整数custId){
this.custId=custId;
}
公共字符串getCustDevice(){
返回装置;
}
公共void setCustDevice(字符串custDevice){
this.custDevice=custDevice;
}
公共字符串getBgDeviceBrand(){
返回设备品牌;
}
公用设备品牌(字符串bgDeviceBrand){
this.bgDeviceBrand=bgDeviceBrand;
}
公共字符串getBgDeviceModel(){
返回bgDeviceModel;
}
public void setBgDeviceModel(字符串bgDeviceModel){
this.bgDeviceModel=bgDeviceModel;
}
公共字符串getAndroidVer(){
返回androidVer;
}
public void setAndroidVer(字符串androidVer){
this.androidVer=androidVer;
}
公共字符串getDeviceMac(){
回流装置;
}
公共void setDeviceMac(字符串deviceMac){
this.deviceMac=deviceMac;
}
公共对象getOpt(){
返回opt;
}
公共无效设置选项(对象选项){
this.opt=opt;
}
}
/**
*客户事件的内部类
*/
公共静态类CustomerEvent实现可序列化{
@序列化名称(“票号”)
@暴露
私有字符串ticketNo;
@序列化名称(“座位号”)
@暴露
私人字符串seatNo;
@SerializedName(“事件名称”)
@暴露
私有字符串eventName;
@SerializedName(“开始日期”)
@暴露
私人街
private void eventDetial(Map<String, String> map) {
Call<OtpCheck> call = apiInterface.eventShow(map);
call.enqueue(new Callback<OtpCheck>() {
@Override
public void onResponse(Call<OtpCheck> call, Response<OtpCheck> response) {
List<OtpCheck.EventDetail> data = response.body().getEventDetails();
for (int i = 0; i < 1; i++) {
image = data.get(i).getEventimg();
Log.i("Data", "data");
Glide.with(getActivity()).load(image).into(imageView);
}
}
@Override
public void onFailure(Call<OtpCheck> call, Throwable t) {
Toast.makeText(getContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
}
});
}
}
@SerializedName("Event")
@Expose
private List<EventDetail> eventDetails;
@SerializedName("All_Event")
@Expose
private List<EventDetail> eventDetails;
@SerializedName("Customer_Data")
@Expose
private String customerData;
@SerializedName("Customer_Device")
@Expose
private String customerDevice;
@SerializedName("Customer_Event")
@Expose
private String customerEvent;
@SerializedName("Event")
@Expose
private List<EventDetail> eventDetails;
@SerializedName("All_Event")
@Expose
private List<EventDetail> eventDetails;