1 /* 2 * Copyright (C) 2016 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 package com.android.tv.data; 18 19 import android.support.annotation.IntDef; 20 import java.lang.annotation.Retention; 21 import java.lang.annotation.RetentionPolicy; 22 import java.util.Collections; 23 import java.util.List; 24 25 /** A class that represents a lineup. */ 26 public class Lineup { 27 /** The ID of this lineup. */ getId()28 public String getId() { 29 return id; 30 } 31 32 /** The type associated with this lineup. */ getType()33 public int getType() { 34 return type; 35 } 36 37 /** The human readable name associated with this lineup. */ getName()38 public String getName() { 39 return name; 40 } 41 42 /** The human readable name associated with this lineup. */ getLocation()43 public String getLocation() { 44 return location; 45 } 46 47 /** An unmodifiable list of channel numbers that this lineup has. */ getChannels()48 public List<String> getChannels() { 49 return channels; 50 } 51 52 private final String id; 53 54 private final int type; 55 56 private final String name; 57 58 private final String location; 59 60 private final List<String> channels; 61 62 @Retention(RetentionPolicy.SOURCE) 63 @IntDef({ 64 LINEUP_CABLE, 65 LINEUP_SATELLITE, 66 LINEUP_BROADCAST_DIGITAL, 67 LINEUP_BROADCAST_ANALOG, 68 LINEUP_IPTV, 69 LINEUP_MVPD, 70 LINEUP_INTERNET, 71 LINEUP_OTHER 72 }) 73 public @interface LineupType {} 74 75 /** Lineup type for cable. */ 76 public static final int LINEUP_CABLE = 0; 77 78 /** Lineup type for satelite. */ 79 public static final int LINEUP_SATELLITE = 1; 80 81 /** Lineup type for broadcast digital. */ 82 public static final int LINEUP_BROADCAST_DIGITAL = 2; 83 84 /** Lineup type for broadcast analog. */ 85 public static final int LINEUP_BROADCAST_ANALOG = 3; 86 87 /** Lineup type for IPTV. */ 88 public static final int LINEUP_IPTV = 4; 89 90 /** 91 * Indicates the lineup is either satellite, cable or IPTV but we are not sure which specific 92 * type. 93 */ 94 public static final int LINEUP_MVPD = 5; 95 96 /** Lineup type for Internet. */ 97 public static final int LINEUP_INTERNET = 6; 98 99 /** Lineup type for other. */ 100 public static final int LINEUP_OTHER = 7; 101 102 /** Creates a lineup. */ Lineup(String id, int type, String name, String location, List<String> channels)103 public Lineup(String id, int type, String name, String location, List<String> channels) { 104 this.id = id; 105 this.type = type; 106 this.name = name; 107 this.location = location; 108 this.channels = Collections.unmodifiableList(channels); 109 } 110 } 111