1/*
2 * Copyright (C) 2014 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 */
14package android.support.v17.leanback.widget;
15
16import static android.support.v17.leanback.widget.ObjectAdapter.NO_ID;
17
18/**
19 * A header item describes the metadata of a {@link Row}, such as a category
20 * of media items.  May be subclassed to add more information.
21 */
22public class HeaderItem {
23
24    private final long mId;
25    private final String mName;
26
27    /**
28     * Create a header item.  All fields are optional.
29     */
30    public HeaderItem(long id, String name) {
31        mId = id;
32        mName = name;
33    }
34
35    /**
36     * Create a header item.
37     */
38    public HeaderItem(String name) {
39        this(NO_ID, name);
40    }
41
42    /**
43     * Returns a unique identifier for this item.
44     */
45    public final long getId() {
46        return mId;
47    }
48
49    /**
50     * Returns the name of this header item.
51     */
52    public final String getName() {
53        return mName;
54    }
55}
56