]> git.basschouten.com Git - openhab-addons.git/blob
f6bb355cf15207919bc88ebd86d697be65cf5dfe
[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.tankerkoenig.internal.dto;
14
15 /**
16  * The {@link OpeningTimes} class is representing all OpeningTimes entries for a station from the api request (i.e array
17  * of settings like "Montag" "09:00" "18:00")
18  * plus the boolean WholeDay (open).
19  *
20  * @author Jürgen Baginski - Initial contribution
21  */
22 public class OpeningTimes {
23
24     private Boolean wholeDay;
25     private OpeningTime[] openingTimes;
26     private String id;
27
28     public OpeningTimes(String id, Boolean wholeDay, OpeningTime[] lopeningTimes) {
29         this.wholeDay = wholeDay;
30         this.openingTimes = lopeningTimes;
31         this.id = id;
32     }
33
34     public Boolean getWholeDay() {
35         return wholeDay;
36     }
37
38     public void setWholeDay(Boolean wholeDay) {
39         this.wholeDay = wholeDay;
40     }
41
42     public OpeningTime[] getOpeningTimes() {
43         return openingTimes;
44     }
45
46     public void setOpeningTimes(OpeningTime[] openingTimes) {
47         this.openingTimes = openingTimes;
48     }
49
50     public String getid() {
51         return id;
52     }
53
54     public void setid(String id) {
55         this.id = id;
56     }
57
58     @Override
59     public String toString() {
60         StringBuilder sb = new StringBuilder();
61         sb.append("WholeDay: ").append(this.getWholeDay().toString()).append("/ Days: ");
62         for (OpeningTime ot : this.getOpeningTimes()) {
63             sb.append(ot.toString());
64         }
65         return sb.toString();
66     }
67 }