]> git.basschouten.com Git - openhab-addons.git/blob
fa62adc0d2b9fe394351ce13dad2f0f52b69178c
[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.solarwatt.internal.domain;
14
15 import javax.measure.Unit;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * Aggregation of the interesting parts to write into a channel.
22  *
23  * From this the {@link ChannelType}s are created.
24  *
25  * @author Sven Carstens - Initial contribution
26  */
27 @NonNullByDefault
28 public class SolarwattChannel {
29     private final String channelName;
30     private final @Nullable Unit<?> unit;
31     private final String category;
32     private final Boolean advanced;
33
34     public SolarwattChannel(String channelName, String category) {
35         this(channelName, category, false);
36     }
37
38     public SolarwattChannel(String channelName, Unit<?> unit, String category) {
39         this(channelName, unit, category, false);
40     }
41
42     public SolarwattChannel(String channelName, String category, Boolean advanced) {
43         this(channelName, null, category, advanced);
44     }
45
46     public SolarwattChannel(String channelName, @Nullable Unit<?> unit, String category, Boolean advanced) {
47         this.channelName = channelName;
48         this.unit = unit;
49         this.category = category;
50         this.advanced = advanced;
51     }
52
53     public String getChannelName() {
54         return this.channelName;
55     }
56
57     public @Nullable Unit<?> getUnit() {
58         return this.unit;
59     }
60
61     public String getCategory() {
62         return this.category;
63     }
64
65     public Boolean getAdvanced() {
66         return this.advanced;
67     }
68 }