1 /* 2 * Copyright (C) 2017 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 package com.example.android.tv.channelsprograms.model; 15 16 /** Contains the data about a channel that will be displayed on the launcher. */ 17 public class Subscription { 18 19 private long channelId; 20 private String name; 21 private String description; 22 private String appLinkIntentUri; 23 private int channelLogo; 24 25 /** Constructor for Gson to use. */ Subscription()26 public Subscription() {} 27 Subscription( String name, String description, String appLinkIntentUri, int channelLogo)28 private Subscription( 29 String name, String description, String appLinkIntentUri, int channelLogo) { 30 this.name = name; 31 this.description = description; 32 this.appLinkIntentUri = appLinkIntentUri; 33 this.channelLogo = channelLogo; 34 } 35 createSubscription( String name, String description, String appLinkIntentUri, int channelLogo)36 public static Subscription createSubscription( 37 String name, String description, String appLinkIntentUri, int channelLogo) { 38 return new Subscription(name, description, appLinkIntentUri, channelLogo); 39 } 40 getChannelId()41 public long getChannelId() { 42 return channelId; 43 } 44 setChannelId(long channelId)45 public void setChannelId(long channelId) { 46 this.channelId = channelId; 47 } 48 getName()49 public String getName() { 50 return name; 51 } 52 setName(String name)53 public void setName(String name) { 54 this.name = name; 55 } 56 getAppLinkIntentUri()57 public String getAppLinkIntentUri() { 58 return appLinkIntentUri; 59 } 60 setAppLinkIntentUri(String appLinkIntentUri)61 public void setAppLinkIntentUri(String appLinkIntentUri) { 62 this.appLinkIntentUri = appLinkIntentUri; 63 } 64 getDescription()65 public String getDescription() { 66 return description; 67 } 68 setDescription(String description)69 public void setDescription(String description) { 70 this.description = description; 71 } 72 getChannelLogo()73 public int getChannelLogo() { 74 return channelLogo; 75 } 76 setChannelLogo(int channelLogo)77 public void setChannelLogo(int channelLogo) { 78 this.channelLogo = channelLogo; 79 } 80 } 81