1 /*
2  * Copyright (C) 2015 Samsung System LSI
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * 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
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 package com.android.bluetooth.map;
16 
17 import com.android.bluetooth.SignedLongLong;
18 
19 /** Local representation of an Android contact */
20 public class MapContact {
21     private final String mName;
22     private final long mId;
23 
MapContact(long id, String name)24     private MapContact(long id, String name) {
25         mId = id;
26         mName = name;
27     }
28 
create(long id, String name)29     public static MapContact create(long id, String name) {
30         return new MapContact(id, name);
31     }
32 
getName()33     public String getName() {
34         return mName;
35     }
36 
getId()37     public long getId() {
38         return mId;
39     }
40 
getXBtUidString()41     public String getXBtUidString() {
42         if (mId > 0) {
43             return BluetoothMapUtils.getLongLongAsString(mId, 0);
44         }
45         return null;
46     }
47 
getXBtUid()48     public SignedLongLong getXBtUid() {
49         if (mId > 0) {
50             return new SignedLongLong(mId, 0);
51         }
52         return null;
53     }
54 
55     @Override
toString()56     public String toString() {
57         return mName;
58     }
59 }
60