10fbfc30aSopenharmony_ci/**
20fbfc30aSopenharmony_ci * @file Describe the file
30fbfc30aSopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
40fbfc30aSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
50fbfc30aSopenharmony_ci * you may not use this file except in compliance with the License.
60fbfc30aSopenharmony_ci * You may obtain a copy of the License at
70fbfc30aSopenharmony_ci *
80fbfc30aSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
90fbfc30aSopenharmony_ci *
100fbfc30aSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
110fbfc30aSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
120fbfc30aSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130fbfc30aSopenharmony_ci * See the License for the specific language governing permissions and
140fbfc30aSopenharmony_ci * limitations under the License.
150fbfc30aSopenharmony_ci */
160fbfc30aSopenharmony_ci
170fbfc30aSopenharmony_ciimport data_rdb from '@ohos.data.relationalStore';
180fbfc30aSopenharmony_ciimport { CalendarAlerts } from './CalendarAlerts';
190fbfc30aSopenharmony_ciimport { CalendarAlertsIndexes } from './CalendarAlertsIndexes';
200fbfc30aSopenharmony_ci
210fbfc30aSopenharmony_ci/**
220fbfc30aSopenharmony_ci * parse all columns for table CalendarAlerts
230fbfc30aSopenharmony_ci *
240fbfc30aSopenharmony_ci * @param resultSet the result from somewhere rdb.query
250fbfc30aSopenharmony_ci */
260fbfc30aSopenharmony_ciexport function parseCalendarAlerts(resultSet: data_rdb.ResultSet,
270fbfc30aSopenharmony_ci                                    indexes: CalendarAlertsIndexes): CalendarAlerts | undefined {
280fbfc30aSopenharmony_ci  if (resultSet === null || resultSet === undefined) {
290fbfc30aSopenharmony_ci    return undefined;
300fbfc30aSopenharmony_ci  }
310fbfc30aSopenharmony_ci  let calendarAlerts: CalendarAlerts = new CalendarAlerts();
320fbfc30aSopenharmony_ci  if (indexes.idIndex >= 0) {
330fbfc30aSopenharmony_ci    calendarAlerts.id = resultSet.getLong(indexes.idIndex);
340fbfc30aSopenharmony_ci  }
350fbfc30aSopenharmony_ci  if (indexes.eventIdIndex >= 0) {
360fbfc30aSopenharmony_ci    calendarAlerts.eventId = resultSet.getLong(indexes.eventIdIndex);
370fbfc30aSopenharmony_ci  }
380fbfc30aSopenharmony_ci  if (indexes.beginIndex >= 0) {
390fbfc30aSopenharmony_ci    calendarAlerts.begin = resultSet.getLong(indexes.beginIndex);
400fbfc30aSopenharmony_ci  }
410fbfc30aSopenharmony_ci  if (indexes.endIndex >= 0) {
420fbfc30aSopenharmony_ci    calendarAlerts.end = resultSet.getLong(indexes.endIndex);
430fbfc30aSopenharmony_ci  }
440fbfc30aSopenharmony_ci  if (indexes.alarmTimeIndex >= 0) {
450fbfc30aSopenharmony_ci    calendarAlerts.alarmTime = resultSet.getLong(indexes.alarmTimeIndex);
460fbfc30aSopenharmony_ci  }
470fbfc30aSopenharmony_ci  if (indexes.creationTimeIndex >= 0) {
480fbfc30aSopenharmony_ci    calendarAlerts.creationTime = resultSet.getLong(indexes.creationTimeIndex);
490fbfc30aSopenharmony_ci  }
500fbfc30aSopenharmony_ci  if (indexes.receivedTimeIndex >= 0) {
510fbfc30aSopenharmony_ci    calendarAlerts.receivedTime = resultSet.getLong(indexes.receivedTimeIndex);
520fbfc30aSopenharmony_ci  }
530fbfc30aSopenharmony_ci  if (indexes.notifyTimeIndex >= 0) {
540fbfc30aSopenharmony_ci    calendarAlerts.notifyTime = resultSet.getLong(indexes.notifyTimeIndex);
550fbfc30aSopenharmony_ci  }
560fbfc30aSopenharmony_ci  if (indexes.stateIndex >= 0) {
570fbfc30aSopenharmony_ci    calendarAlerts.state = resultSet.getLong(indexes.stateIndex);
580fbfc30aSopenharmony_ci  }
590fbfc30aSopenharmony_ci  if (indexes.minutesIndex >= 0) {
600fbfc30aSopenharmony_ci    calendarAlerts.minutes = resultSet.getLong(indexes.minutesIndex);
610fbfc30aSopenharmony_ci  }
620fbfc30aSopenharmony_ci  if (indexes.creatorIndex >= 0) {
630fbfc30aSopenharmony_ci    calendarAlerts.creator = resultSet.getString(indexes.creatorIndex);
640fbfc30aSopenharmony_ci  }
650fbfc30aSopenharmony_ci  return calendarAlerts;
660fbfc30aSopenharmony_ci}