18779efd5Sopenharmony_ci/** 28779efd5Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd. 38779efd5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 48779efd5Sopenharmony_ci * you may not use this file except in compliance with the License. 58779efd5Sopenharmony_ci * You may obtain a copy of the License at 68779efd5Sopenharmony_ci * 78779efd5Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 88779efd5Sopenharmony_ci * 98779efd5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 108779efd5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 118779efd5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128779efd5Sopenharmony_ci * See the License for the specific language governing permissions and 138779efd5Sopenharmony_ci * limitations under the License. 148779efd5Sopenharmony_ci */ 158779efd5Sopenharmony_ci 168779efd5Sopenharmony_ciimport { StringUtil } from '../../../../../../common/src/main/ets/util/StringUtil'; 178779efd5Sopenharmony_ci 188779efd5Sopenharmony_ci/** 198779efd5Sopenharmony_ci * Contact List Data Structure Entity 208779efd5Sopenharmony_ci */ 218779efd5Sopenharmony_ciexport class ContactVo { 228779efd5Sopenharmony_ci contactId: string; 238779efd5Sopenharmony_ci namePrefix: string; 248779efd5Sopenharmony_ci emptyNameData: string; 258779efd5Sopenharmony_ci company: string; 268779efd5Sopenharmony_ci position: string; 278779efd5Sopenharmony_ci portraitColor: string; 288779efd5Sopenharmony_ci show: boolean; 298779efd5Sopenharmony_ci portraitPath: string; 308779efd5Sopenharmony_ci nameSuffix: string; 318779efd5Sopenharmony_ci phoneNum: string; 328779efd5Sopenharmony_ci showName: string; 338779efd5Sopenharmony_ci phoneNumbers: object[]; 348779efd5Sopenharmony_ci name: NameVo; 358779efd5Sopenharmony_ci title: string; 368779efd5Sopenharmony_ci subTitle: string; 378779efd5Sopenharmony_ci constructor(contactId: string, 388779efd5Sopenharmony_ci namePrefix: string, 398779efd5Sopenharmony_ci emptyNameData: string, 408779efd5Sopenharmony_ci company: string, 418779efd5Sopenharmony_ci position: string, 428779efd5Sopenharmony_ci portraitColor: string, 438779efd5Sopenharmony_ci show: boolean, 448779efd5Sopenharmony_ci portraitPath: string, 458779efd5Sopenharmony_ci phoneNum: string 468779efd5Sopenharmony_ci ) { 478779efd5Sopenharmony_ci this.contactId = contactId; 488779efd5Sopenharmony_ci this.namePrefix = namePrefix; 498779efd5Sopenharmony_ci this.emptyNameData = emptyNameData; 508779efd5Sopenharmony_ci this.company = company; 518779efd5Sopenharmony_ci this.position = position; 528779efd5Sopenharmony_ci this.portraitColor = portraitColor; 538779efd5Sopenharmony_ci this.show = show; 548779efd5Sopenharmony_ci this.portraitPath = portraitPath; 558779efd5Sopenharmony_ci this.phoneNum = phoneNum; 568779efd5Sopenharmony_ci } 578779efd5Sopenharmony_ci 588779efd5Sopenharmony_ci public setShowName() { 598779efd5Sopenharmony_ci this.showName = !StringUtil.isEmpty(this.emptyNameData) ? this.emptyNameData : (!StringUtil.isEmpty(this.company) ? this.company : (!StringUtil.isEmpty(this.position) ? this.position : '')) 608779efd5Sopenharmony_ci } 618779efd5Sopenharmony_ci 628779efd5Sopenharmony_ci public setName(emptyNameData: string, namePrefix: string, nameSuffix: string) { 638779efd5Sopenharmony_ci this.name = new NameVo(emptyNameData, namePrefix, nameSuffix); 648779efd5Sopenharmony_ci } 658779efd5Sopenharmony_ci 668779efd5Sopenharmony_ci public setphoneNumbers(phoneNumbers: object[]) { 678779efd5Sopenharmony_ci this.phoneNumbers = phoneNumbers; 688779efd5Sopenharmony_ci } 698779efd5Sopenharmony_ci 708779efd5Sopenharmony_ci public setTitle(title: string) { 718779efd5Sopenharmony_ci this.title = title; 728779efd5Sopenharmony_ci } 738779efd5Sopenharmony_ci 748779efd5Sopenharmony_ci public setSubTitle(subTitle: string) { 758779efd5Sopenharmony_ci this.subTitle = subTitle; 768779efd5Sopenharmony_ci } 778779efd5Sopenharmony_ci} 788779efd5Sopenharmony_ci 798779efd5Sopenharmony_ciexport class NameVo { 808779efd5Sopenharmony_ci fullName: string; 818779efd5Sopenharmony_ci namePrefix: string; 828779efd5Sopenharmony_ci nameSuffix: string; 838779efd5Sopenharmony_ci searchTextStart: string; 848779efd5Sopenharmony_ci searchTextMiddle: string; 858779efd5Sopenharmony_ci searchTextEnd: string; 868779efd5Sopenharmony_ci constructor(emptyNameData: string, namePrefix: string, nameSuffix: string) { 878779efd5Sopenharmony_ci this.fullName = emptyNameData; 888779efd5Sopenharmony_ci this.namePrefix = namePrefix; 898779efd5Sopenharmony_ci this.nameSuffix = nameSuffix; 908779efd5Sopenharmony_ci } 918779efd5Sopenharmony_ci}