• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License
15  */
16 
17 
18 
19 package com.android.tv.search;
20 
21 import android.support.annotation.Nullable;
22 
23 /**
24  * Hand copy of generated Autovalue class.
25  *
26  * TODO get autovalue working
27  */
28 
29 final class AutoValue_LocalSearchProvider_SearchResult extends LocalSearchProvider.SearchResult {
30 
31     private final long channelId;
32     private final String channelNumber;
33     private final String title;
34     private final String description;
35     private final String imageUri;
36     private final String intentAction;
37     private final String intentData;
38     private final String intentExtraData;
39     private final String contentType;
40     private final boolean isLive;
41     private final int videoWidth;
42     private final int videoHeight;
43     private final long duration;
44     private final int progressPercentage;
45 
AutoValue_LocalSearchProvider_SearchResult( long channelId, @Nullable String channelNumber, @Nullable String title, @Nullable String description, @Nullable String imageUri, @Nullable String intentAction, @Nullable String intentData, @Nullable String intentExtraData, @Nullable String contentType, boolean isLive, int videoWidth, int videoHeight, long duration, int progressPercentage)46     private AutoValue_LocalSearchProvider_SearchResult(
47             long channelId,
48             @Nullable String channelNumber,
49             @Nullable String title,
50             @Nullable String description,
51             @Nullable String imageUri,
52             @Nullable String intentAction,
53             @Nullable String intentData,
54             @Nullable String intentExtraData,
55             @Nullable String contentType,
56             boolean isLive,
57             int videoWidth,
58             int videoHeight,
59             long duration,
60             int progressPercentage) {
61         this.channelId = channelId;
62         this.channelNumber = channelNumber;
63         this.title = title;
64         this.description = description;
65         this.imageUri = imageUri;
66         this.intentAction = intentAction;
67         this.intentData = intentData;
68         this.intentExtraData = intentExtraData;
69         this.contentType = contentType;
70         this.isLive = isLive;
71         this.videoWidth = videoWidth;
72         this.videoHeight = videoHeight;
73         this.duration = duration;
74         this.progressPercentage = progressPercentage;
75     }
76 
77     @Override
getChannelId()78     long getChannelId() {
79         return channelId;
80     }
81 
82     @Nullable
83     @Override
getChannelNumber()84     String getChannelNumber() {
85         return channelNumber;
86     }
87 
88     @Nullable
89     @Override
getTitle()90     String getTitle() {
91         return title;
92     }
93 
94     @Nullable
95     @Override
getDescription()96     String getDescription() {
97         return description;
98     }
99 
100     @Nullable
101     @Override
getImageUri()102     String getImageUri() {
103         return imageUri;
104     }
105 
106     @Nullable
107     @Override
getIntentAction()108     String getIntentAction() {
109         return intentAction;
110     }
111 
112     @Nullable
113     @Override
getIntentData()114     String getIntentData() {
115         return intentData;
116     }
117 
118     @Nullable
119     @Override
getIntentExtraData()120     String getIntentExtraData() {
121         return intentExtraData;
122     }
123 
124     @Nullable
125     @Override
getContentType()126     String getContentType() {
127         return contentType;
128     }
129 
130     @Override
getIsLive()131     boolean getIsLive() {
132         return isLive;
133     }
134 
135     @Override
getVideoWidth()136     int getVideoWidth() {
137         return videoWidth;
138     }
139 
140     @Override
getVideoHeight()141     int getVideoHeight() {
142         return videoHeight;
143     }
144 
145     @Override
getDuration()146     long getDuration() {
147         return duration;
148     }
149 
150     @Override
getProgressPercentage()151     int getProgressPercentage() {
152         return progressPercentage;
153     }
154 
155     @Override
toString()156     public String toString() {
157         return "SearchResult{"
158                 + "channelId=" + channelId + ", "
159                 + "channelNumber=" + channelNumber + ", "
160                 + "title=" + title + ", "
161                 + "description=" + description + ", "
162                 + "imageUri=" + imageUri + ", "
163                 + "intentAction=" + intentAction + ", "
164                 + "intentData=" + intentData + ", "
165                 + "intentExtraData=" + intentExtraData + ", "
166                 + "contentType=" + contentType + ", "
167                 + "isLive=" + isLive + ", "
168                 + "videoWidth=" + videoWidth + ", "
169                 + "videoHeight=" + videoHeight + ", "
170                 + "duration=" + duration + ", "
171                 + "progressPercentage=" + progressPercentage
172                 + "}";
173     }
174 
175     @Override
equals(Object o)176     public boolean equals(Object o) {
177         if (o == this) {
178             return true;
179         }
180         if (o instanceof LocalSearchProvider.SearchResult) {
181             LocalSearchProvider.SearchResult that = (LocalSearchProvider.SearchResult) o;
182             return (this.channelId == that.getChannelId())
183                     && ((this.channelNumber == null) ? (that.getChannelNumber() == null) : this.channelNumber.equals(that.getChannelNumber()))
184                     && ((this.title == null) ? (that.getTitle() == null) : this.title.equals(that.getTitle()))
185                     && ((this.description == null) ? (that.getDescription() == null) : this.description.equals(that.getDescription()))
186                     && ((this.imageUri == null) ? (that.getImageUri() == null) : this.imageUri.equals(that.getImageUri()))
187                     && ((this.intentAction == null) ? (that.getIntentAction() == null) : this.intentAction.equals(that.getIntentAction()))
188                     && ((this.intentData == null) ? (that.getIntentData() == null) : this.intentData.equals(that.getIntentData()))
189                     && ((this.intentExtraData == null) ? (that.getIntentExtraData() == null) : this.intentExtraData.equals(that.getIntentExtraData()))
190                     && ((this.contentType == null) ? (that.getContentType() == null) : this.contentType.equals(that.getContentType()))
191                     && (this.isLive == that.getIsLive())
192                     && (this.videoWidth == that.getVideoWidth())
193                     && (this.videoHeight == that.getVideoHeight())
194                     && (this.duration == that.getDuration())
195                     && (this.progressPercentage == that.getProgressPercentage());
196         }
197         return false;
198     }
199 
200     @Override
hashCode()201     public int hashCode() {
202         int h$ = 1;
203         h$ *= 1000003;
204         h$ ^= (int) ((channelId >>> 32) ^ channelId);
205         h$ *= 1000003;
206         h$ ^= (channelNumber == null) ? 0 : channelNumber.hashCode();
207         h$ *= 1000003;
208         h$ ^= (title == null) ? 0 : title.hashCode();
209         h$ *= 1000003;
210         h$ ^= (description == null) ? 0 : description.hashCode();
211         h$ *= 1000003;
212         h$ ^= (imageUri == null) ? 0 : imageUri.hashCode();
213         h$ *= 1000003;
214         h$ ^= (intentAction == null) ? 0 : intentAction.hashCode();
215         h$ *= 1000003;
216         h$ ^= (intentData == null) ? 0 : intentData.hashCode();
217         h$ *= 1000003;
218         h$ ^= (intentExtraData == null) ? 0 : intentExtraData.hashCode();
219         h$ *= 1000003;
220         h$ ^= (contentType == null) ? 0 : contentType.hashCode();
221         h$ *= 1000003;
222         h$ ^= isLive ? 1231 : 1237;
223         h$ *= 1000003;
224         h$ ^= videoWidth;
225         h$ *= 1000003;
226         h$ ^= videoHeight;
227         h$ *= 1000003;
228         h$ ^= (int) ((duration >>> 32) ^ duration);
229         h$ *= 1000003;
230         h$ ^= progressPercentage;
231         return h$;
232     }
233 
234     static final class Builder extends LocalSearchProvider.SearchResult.Builder {
235         private Long channelId;
236         private String channelNumber;
237         private String title;
238         private String description;
239         private String imageUri;
240         private String intentAction;
241         private String intentData;
242         private String intentExtraData;
243         private String contentType;
244         private Boolean isLive;
245         private Integer videoWidth;
246         private Integer videoHeight;
247         private Long duration;
248         private Integer progressPercentage;
Builder()249         Builder() {
250         }
251         @Override
setChannelId(long channelId)252         LocalSearchProvider.SearchResult.Builder setChannelId(long channelId) {
253             this.channelId = channelId;
254             return this;
255         }
256         @Override
setChannelNumber(@ullable String channelNumber)257         LocalSearchProvider.SearchResult.Builder setChannelNumber(@Nullable String channelNumber) {
258             this.channelNumber = channelNumber;
259             return this;
260         }
261         @Override
setTitle(@ullable String title)262         LocalSearchProvider.SearchResult.Builder setTitle(@Nullable String title) {
263             this.title = title;
264             return this;
265         }
266         @Override
setDescription(@ullable String description)267         LocalSearchProvider.SearchResult.Builder setDescription(@Nullable String description) {
268             this.description = description;
269             return this;
270         }
271         @Override
setImageUri(@ullable String imageUri)272         LocalSearchProvider.SearchResult.Builder setImageUri(@Nullable String imageUri) {
273             this.imageUri = imageUri;
274             return this;
275         }
276         @Override
setIntentAction(@ullable String intentAction)277         LocalSearchProvider.SearchResult.Builder setIntentAction(@Nullable String intentAction) {
278             this.intentAction = intentAction;
279             return this;
280         }
281         @Override
setIntentData(@ullable String intentData)282         LocalSearchProvider.SearchResult.Builder setIntentData(@Nullable String intentData) {
283             this.intentData = intentData;
284             return this;
285         }
286         @Override
setIntentExtraData(@ullable String intentExtraData)287         LocalSearchProvider.SearchResult.Builder setIntentExtraData(@Nullable String intentExtraData) {
288             this.intentExtraData = intentExtraData;
289             return this;
290         }
291         @Override
setContentType(@ullable String contentType)292         LocalSearchProvider.SearchResult.Builder setContentType(@Nullable String contentType) {
293             this.contentType = contentType;
294             return this;
295         }
296         @Override
setIsLive(boolean isLive)297         LocalSearchProvider.SearchResult.Builder setIsLive(boolean isLive) {
298             this.isLive = isLive;
299             return this;
300         }
301         @Override
setVideoWidth(int videoWidth)302         LocalSearchProvider.SearchResult.Builder setVideoWidth(int videoWidth) {
303             this.videoWidth = videoWidth;
304             return this;
305         }
306         @Override
setVideoHeight(int videoHeight)307         LocalSearchProvider.SearchResult.Builder setVideoHeight(int videoHeight) {
308             this.videoHeight = videoHeight;
309             return this;
310         }
311         @Override
setDuration(long duration)312         LocalSearchProvider.SearchResult.Builder setDuration(long duration) {
313             this.duration = duration;
314             return this;
315         }
316         @Override
setProgressPercentage(int progressPercentage)317         LocalSearchProvider.SearchResult.Builder setProgressPercentage(int progressPercentage) {
318             this.progressPercentage = progressPercentage;
319             return this;
320         }
321         @Override
build()322         LocalSearchProvider.SearchResult build() {
323             String missing = "";
324             if (this.channelId == null) {
325                 missing += " channelId";
326             }
327             if (this.isLive == null) {
328                 missing += " isLive";
329             }
330             if (this.videoWidth == null) {
331                 missing += " videoWidth";
332             }
333             if (this.videoHeight == null) {
334                 missing += " videoHeight";
335             }
336             if (this.duration == null) {
337                 missing += " duration";
338             }
339             if (this.progressPercentage == null) {
340                 missing += " progressPercentage";
341             }
342             if (!missing.isEmpty()) {
343                 throw new IllegalStateException("Missing required properties:" + missing);
344             }
345             return new AutoValue_LocalSearchProvider_SearchResult(
346                     this.channelId,
347                     this.channelNumber,
348                     this.title,
349                     this.description,
350                     this.imageUri,
351                     this.intentAction,
352                     this.intentData,
353                     this.intentExtraData,
354                     this.contentType,
355                     this.isLive,
356                     this.videoWidth,
357                     this.videoHeight,
358                     this.duration,
359                     this.progressPercentage);
360         }
361     }
362 
363 }
364