1/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5 * in compliance with the License. You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software distributed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 * or implied. See the License for the specific language governing permissions and limitations under
12 * the License.
13 *
14 */
15
16package android.support.v17.leanback.supportleanbackshowcase.models;
17
18import android.content.Context;
19import android.support.v17.leanback.supportleanbackshowcase.models.Card;
20
21import com.google.gson.annotations.SerializedName;
22
23public class DetailedCard {
24
25    @SerializedName("title") private String mTitle = "";
26    @SerializedName("description") private String mDescription = "";
27    @SerializedName("text") private String mText = "";
28    @SerializedName("localImageResource") private String mLocalImageResource = null;
29    @SerializedName("price") private String mPrice = null;
30    @SerializedName("characters") private Card[] mCharacters = null;
31    @SerializedName("recommended") private Card[] mRecommended = null;
32    @SerializedName("year") private int mYear = 0;
33
34
35    public String getPrice() {
36        return mPrice;
37    }
38
39    public int getYear() {
40        return mYear;
41    }
42
43    public String getLocalImageResource() {
44        return mLocalImageResource;
45    }
46
47    public String getText() {
48        return mText;
49    }
50
51    public String getDescription() {
52        return mDescription;
53    }
54
55    public String getTitle() {
56        return mTitle;
57    }
58
59    public Card[] getCharacters() {
60        return mCharacters;
61    }
62
63    public Card[] getRecommended() {
64        return mRecommended;
65    }
66
67    public int getLocalImageResourceId(Context context) {
68        return context.getResources()
69                      .getIdentifier(getLocalImageResource(), "drawable", context.getPackageName());
70    }
71}
72