1/**
2 * @file Describe the file
3 * Copyright (c) 2023 Huawei Device Co., Ltd.
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
17import data_rdb from '@ohos.data.relationalStore';
18import { ObserverMessage } from '@ohos/common/src/main/ets/observer/Observer';
19
20/**
21 * the Alerts Message, It is used to describe the scenario where the alerts table needs to be updated
22 *
23 * @since 2022-09-09
24 */
25export class AlertsMessage extends ObserverMessage {
26  private mOperationName: string;
27  private mTableName: string;
28  private mValues: data_rdb.ValuesBucket | data_rdb.ValuesBucket[];
29
30  constructor() {
31    super();
32    this.mOperationName = '';
33    this.mTableName = '';
34    this.mValues = {};
35  }
36
37  setOperationName(mOperationName: string) {
38    this.mOperationName = mOperationName;
39  }
40
41  setTableName(mTableName: string) {
42    this.mTableName = mTableName;
43  }
44
45  setValues(mValues: data_rdb.ValuesBucket | data_rdb.ValuesBucket[]) {
46    this.mValues = mValues;
47  }
48
49  getOperationName(): string {
50    return this.mOperationName;
51  }
52
53  getTableName(): string {
54    return this.mTableName;
55  }
56
57  getValues(): data_rdb.ValuesBucket | data_rdb.ValuesBucket[] {
58    return this.mValues;
59  }
60}