• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
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
16export class CallBean {
17  readonly id: string ;
18  phone: string ;
19  name: string ;
20  callTime: string ;
21  // Call type: 1: incoming call; 2: outgoing call; 3: missed call; 5: rejected call
22  callType: string ;
23  // Home area of the number
24  callTag: string ;
25  // Call SIM card. 0: SIM card 1, 1: SIM card 2.
26  simType: string ;
27  // Indicates whether an HD call is supported. true: HD call; false: non-HD call
28  isHd: string ;
29  // Format Phone Number
30  formatNumber: string ;
31  // Contact ID.
32  contactKey: string ;
33  // Call Times
34  num: string;
35  // Indicates whether to be selected. The default value is false.
36  isChecked: boolean = false;
37  portraitColor: string;
38  suffix: string;
39  constructor(id: string, phone: string) {
40    this.id = id;
41    this.phone = phone;
42  }
43
44  setName(name: string): CallBean {
45    this.name = name;
46    return this;
47  }
48
49  setCallTime(callTime: string) {
50    this.callTime = callTime;
51    return this;
52  }
53
54  setCallType(callType: string) {
55    this.callType = callType;
56    return this;
57  }
58
59  setCallTag(callTag: string) {
60    this.callTag = callTag;
61    return this;
62  }
63
64  setSimType(simType: string) {
65    this.simType = simType;
66    return this;
67  }
68
69  setIsHd(isHd: string) {
70    this.isHd = isHd;
71    return this;
72  }
73
74  setFormatNumber(formatNumber: string) {
75    this.formatNumber = formatNumber;
76    return this;
77  }
78
79  setContactKey(contactKey: string) {
80    this.contactKey = contactKey;
81    return this;
82  }
83
84  setNum(num: string) {
85    this.num = num;
86    return this;
87  }
88
89  setIsChecked(isChecked: boolean) {
90    this.isChecked = isChecked;
91    return this;
92  }
93
94  setPortraitColor(portraitColor: string) {
95    this.portraitColor = portraitColor;
96    return this;
97  }
98
99  setSuffix(suffix: string) {
100    this.suffix = suffix;
101    return this;
102  }
103}