]> git.basschouten.com Git - openhab-addons.git/blob
ba42b3c0a4be7e6eb3fad6371a652e592c56197f
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.fineoffsetweatherstation.internal.domain.response;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.fineoffsetweatherstation.internal.domain.MeasureType;
18 import org.openhab.core.thing.type.ChannelTypeUID;
19 import org.openhab.core.types.State;
20
21 /**
22  * A certain measured value.
23  *
24  * @author Andreas Berger - Initial contribution
25  */
26 @NonNullByDefault
27 public class MeasuredValue {
28     private final MeasureType measureType;
29     private final String channelId;
30     private final @Nullable ChannelTypeUID channelTypeUID;
31     private final State state;
32     private final String debugName;
33
34     public MeasuredValue(MeasureType measureType, String channelId, @Nullable ChannelTypeUID channelTypeUID,
35             State state, String debugName) {
36         this.measureType = measureType;
37         this.channelId = channelId;
38         this.channelTypeUID = channelTypeUID;
39         this.state = state;
40         this.debugName = debugName;
41     }
42
43     public MeasureType getMeasureType() {
44         return measureType;
45     }
46
47     public String getChannelId() {
48         return channelId;
49     }
50
51     public @Nullable ChannelTypeUID getChannelTypeUID() {
52         return channelTypeUID;
53     }
54
55     public State getState() {
56         return state;
57     }
58
59     public String getDebugName() {
60         return debugName;
61     }
62
63     @Override
64     public String toString() {
65         return "MeasuredValue{" + "measureType=" + measureType + ", channelId='" + channelId + '\''
66                 + ", channelTypeUID=" + channelTypeUID + ", state=" + state + ", debugName='" + debugName + '\'' + '}';
67     }
68 }