Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo :) ,

ich habe hier einen Webservice der mir JSON liefert.

[
      {
      "orderId": "2018A096412",
      "orderActivities": [      {
         "id":          {
            "orderId": "2018A096412",
            "flsOrderId": "1142942             "
         },
         "userId": "M30  ",
         "flsStatus": "3  ",
         "status": "A"
      }]
   }
]


Diese JSON wollte ich nun deserialisieren und habe dafür eine POJO Klasse erstellt:

public class Order {
	
	private String orderId;
	private OrderActivities id;
	
	
	public Order() {}

	public String getOrderId() {
		return orderId;
	}

	public OrderActivities getId() {
		return id;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public void setId(OrderActivities id) {
		this.id = id;
	}
}

public class OrderActivities {

	private Id id;
	private String userId;
	private String flsStatus;
	private String status;
	
	public OrderActivities() {}

	
	public String getUserId() {
		return userId;
	}

	public String getFlsStatus() {
		return flsStatus;
	}

	public String getStatus() {
		return status;
	}

	
	
	public void setUserId(String userId) {
		this.userId = userId;
	}

	public void setFlsStatus(String flsStatus) {
		this.flsStatus = flsStatus;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
}

public class Id {

	private String orderId;
	private String flsOrderId;
	
	public String getOrderId() {
		return orderId;
	}

	public String getFlsOrderId() {
		return flsOrderId;
	}
	
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public void setFlsOrderId(String flsOrderId) {
		this.flsOrderId = flsOrderId;
	}
}

OrderId wird auch korrekt deserialisiert, aber der Rest der Elemente nicht mehr. Da scheint was an meinem Klassenaufbau nicht so ganz zu passen, ich weis aber gerade nicht so genau was, da mir kein Fehler geworfen wird.

Wies hier jemand weiter ?

 

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.