5
5
* you may not use this file except in compliance with the License.
6
6
* You may obtain a copy of the License at
7
7
*
8
- * https ://www.apache.org/licenses/LICENSE-2.0
8
+ * http ://www.apache.org/licenses/LICENSE-2.0
9
9
*
10
10
* Unless required by applicable law or agreed to in writing, software
11
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
+
16
17
package com .example .json ;
17
18
18
19
import com .google .api .client .http .HttpResponse ;
19
20
import com .google .api .client .util .Key ;
20
-
21
21
import java .io .IOException ;
22
22
import java .util .List ;
23
23
import java .util .Map ;
@@ -27,8 +27,7 @@ public static class ListResponse {
27
27
@ Key ("items" )
28
28
private List <SearchResult > searchResults ;
29
29
30
- @ Key
31
- private PageInfo pageInfo ;
30
+ @ Key private PageInfo pageInfo ;
32
31
33
32
public List <SearchResult > getSearchResults () {
34
33
return searchResults ;
@@ -40,11 +39,9 @@ public PageInfo getPageInfo() {
40
39
}
41
40
42
41
public static class PageInfo {
43
- @ Key
44
- private long totalResults ;
42
+ @ Key private long totalResults ;
45
43
46
- @ Key
47
- private long resultsPerPage ;
44
+ @ Key private long resultsPerPage ;
48
45
49
46
public long getTotalResults () {
50
47
return totalResults ;
@@ -56,14 +53,12 @@ public long getResultsPerPage() {
56
53
}
57
54
58
55
public static class SearchResult {
59
- @ Key
60
- private String kind ;
56
+ @ Key private String kind ;
61
57
62
58
@ Key ("id" )
63
59
private VideoId videoId ;
64
60
65
- @ Key
66
- private Snippet snippet ;
61
+ @ Key private Snippet snippet ;
67
62
68
63
public String getKind () {
69
64
return kind ;
@@ -79,11 +74,9 @@ public Snippet getSnippet() {
79
74
}
80
75
81
76
public static class VideoId {
82
- @ Key
83
- private String kind ;
77
+ @ Key private String kind ;
84
78
85
- @ Key
86
- private String videoId ;
79
+ @ Key private String videoId ;
87
80
88
81
public String getKind () {
89
82
return kind ;
@@ -95,20 +88,15 @@ public String getVideoId() {
95
88
}
96
89
97
90
public static class Snippet {
98
- @ Key
99
- private String publishedAt ;
91
+ @ Key private String publishedAt ;
100
92
101
- @ Key
102
- private String channelId ;
93
+ @ Key private String channelId ;
103
94
104
- @ Key
105
- private String title ;
95
+ @ Key private String title ;
106
96
107
- @ Key
108
- private String description ;
97
+ @ Key private String description ;
109
98
110
- @ Key
111
- private Map <String , Thumbnail > thumbnails ;
99
+ @ Key private Map <String , Thumbnail > thumbnails ;
112
100
113
101
public String getPublishedAt () {
114
102
return publishedAt ;
@@ -132,14 +120,11 @@ public Map<String, Thumbnail> getThumbnails() {
132
120
}
133
121
134
122
public static class Thumbnail {
135
- @ Key
136
- private String url ;
123
+ @ Key private String url ;
137
124
138
- @ Key
139
- private long width ;
125
+ @ Key private long width ;
140
126
141
- @ Key
142
- private long height ;
127
+ @ Key private long height ;
143
128
144
129
public String getUrl () {
145
130
return url ;
@@ -170,5 +155,4 @@ public static ListResponse parseJson(HttpResponse httpResponse) throws IOExcepti
170
155
}
171
156
return listResponse ;
172
157
}
173
-
174
- }
158
+ }
0 commit comments