]> git.basschouten.com Git - openhab-addons.git/blob
9068fc076cd2ba4f62bab7b50791c3f63fc4f232
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.velbus.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * The {@link VelbusClockAlarmConfiguration} represents a class that contains the configuration of a velbus clock alarm.
19  *
20  * @author Cedric Boon - Initial contribution
21  */
22 @NonNullByDefault
23 public class VelbusClockAlarmConfiguration {
24     private VelbusClockAlarm alarmClock1;
25     private VelbusClockAlarm alarmClock2;
26
27     public VelbusClockAlarmConfiguration() {
28         this.alarmClock1 = new VelbusClockAlarm();
29         this.alarmClock2 = new VelbusClockAlarm();
30     }
31
32     public VelbusClockAlarm getAlarmClock1() {
33         return alarmClock1;
34     }
35
36     public VelbusClockAlarm getAlarmClock2() {
37         return alarmClock2;
38     }
39
40     public VelbusClockAlarm getAlarmClock(int alarmNumber) {
41         if (alarmNumber == 1) {
42             return getAlarmClock1();
43         } else if (alarmNumber == 2) {
44             return getAlarmClock2();
45         } else {
46             throw new IllegalArgumentException("The alarm clock '" + alarmNumber + "' does not exist.");
47         }
48     }
49 }