-
Notifications
You must be signed in to change notification settings - Fork 1
/
Article.java
144 lines (115 loc) · 3.42 KB
/
Article.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package com.enpassio.endatasource.model;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class Article implements Parcelable {
@SerializedName("source")
@Expose
private Source source;
@SerializedName("author")
@Expose
private String author;
@SerializedName("title")
@Expose
private String title;
@SerializedName("description")
@Expose
private String description;
@SerializedName("url")
@Expose
private String url;
@SerializedName("urlToImage")
@Expose
private String urlToImage;
@SerializedName("publishedAt")
@Expose
private String publishedAt;
@SerializedName("content")
@Expose
private String content;
public final static Parcelable.Creator<Article> CREATOR = new Creator<Article>() {
@SuppressWarnings({
"unchecked"
})
public Article createFromParcel(Parcel in) {
return new Article(in);
}
public Article[] newArray(int size) {
return (new Article[size]);
}
};
private Article(Parcel in) {
this.source = ((Source) in.readValue((Source.class.getClassLoader())));
this.author = ((String) in.readValue((String.class.getClassLoader())));
this.title = ((String) in.readValue((String.class.getClassLoader())));
this.description = ((String) in.readValue((String.class.getClassLoader())));
this.url = ((String) in.readValue((String.class.getClassLoader())));
this.urlToImage = ((String) in.readValue((String.class.getClassLoader())));
this.publishedAt = ((String) in.readValue((String.class.getClassLoader())));
this.content = ((String) in.readValue((String.class.getClassLoader())));
}
public Article() {
}
public Source getSource() {
return source;
}
public void setSource(Source source) {
this.source = source;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUrlToImage() {
return urlToImage;
}
public void setUrlToImage(String urlToImage) {
this.urlToImage = urlToImage;
}
public String getPublishedAt() {
return publishedAt;
}
public void setPublishedAt(String publishedAt) {
this.publishedAt = publishedAt;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(source);
dest.writeValue(author);
dest.writeValue(title);
dest.writeValue(description);
dest.writeValue(url);
dest.writeValue(urlToImage);
dest.writeValue(publishedAt);
dest.writeValue(content);
}
public int describeContents() {
return 0;
}
}