commit 06810619eb0c37c13b9d2215944aa0e3da1822ea
parent 1ac1b2a1049655515b811bb28a24629e7931fdd4
Author: William Lindholm <a22willi@student.his.se>
Date: Wed, 3 May 2023 11:46:00 +0200
Created Meteorite class.
Diffstat:
1 file changed, 31 insertions(+), 0 deletions(-)
diff --git a/app/src/main/java/com/example/project_assignment/Meteorite.java b/app/src/main/java/com/example/project_assignment/Meteorite.java
@@ -0,0 +1,31 @@
+package com.example.project_assignment;
+
+import com.google.gson.JsonObject;
+import com.google.gson.annotations.SerializedName;
+
+public class Meteorite {
+ protected String name;
+ protected String id;
+ protected String mass;
+
+ @SerializedName(value = "year", alternate = "date")
+ protected String date;
+
+ @SerializedName(value = "reclat", alternate = "latitude")
+ protected String latitude;
+
+ @SerializedName(value = "reclong", alternate = "longitude")
+ protected String longitude;
+
+ @Override
+ public String toString() {
+ return "Meteorite{" +
+ "name='" + name + '\'' +
+ ", id='" + id + '\'' +
+ ", mass='" + mass + '\'' +
+ ", date='" + date + '\'' +
+ ", latitude='" + latitude + '\'' +
+ ", longitude='" + longitude + '\'' +
+ '}';
+ }
+}