-
Notifications
You must be signed in to change notification settings - Fork 0
/
APOD.java
97 lines (76 loc) · 1.97 KB
/
APOD.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import com.google.gson.*;
import java.io.*;
public class APOD implements Serializable{
private String title;
private String explanation;
private String date;
private String hdurl;
private String serviceVersion;
private String copyright;
private String mediaType;
private String url;
public APOD(String title, String explanation, String date, String hdurl, String serviceVersion, String copyright, String mediaType, String url) {
this.title = title;
this.explanation = explanation;
this.date = date;
this.hdurl = hdurl;
this.serviceVersion = serviceVersion;
this.copyright = copyright;
this.mediaType = mediaType;
this.url = url;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getExplanation() {
return explanation;
}
public void setExplanation(String explanation) {
this.explanation = explanation;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getHdurl() {
return hdurl;
}
public void setHdurl(String hdurl) {
this.hdurl = hdurl;
}
public String getServiceVersion() {
return serviceVersion;
}
public void setServiceVersion(String serviceVersion) {
this.serviceVersion = serviceVersion;
}
public String getCopyright() {
return copyright;
}
public void setCopyright(String copyright) {
this.copyright = copyright;
}
public String getMediaType() {
return mediaType;
}
public void setMediaType(String mediaType) {
this.mediaType = mediaType;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
// You can add a method to convert the object to JSON format using a library like Gson
public String toJson() {
// Implementation using Gson library (assuming you have it included)
Gson gson = new Gson();
return gson.toJson(this);
}
}