]> git.basschouten.com Git - openhab-addons.git/blob
b69a936c259b1045cd9d48dc6e2b6992ef151ef0
[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.heliosventilation.internal;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The {@link HeliosPropertiesFormatException} class defines an exception to describe parsing format errors
20  *
21  * @author Raphael Mack - Initial contribution
22  */
23 @NonNullByDefault
24 public class HeliosPropertiesFormatException extends Exception {
25     private static final long serialVersionUID = 8051109351111509577L;
26     private final String channelName;
27     private final String fullSpec;
28     private final String reason;
29
30     public HeliosPropertiesFormatException(String reason, String channelName, String fullSpec) {
31         this.channelName = channelName;
32         this.fullSpec = fullSpec;
33         this.reason = reason;
34     }
35
36     public String getChannelName() {
37         return channelName;
38     }
39
40     public String getFullSpec() {
41         return fullSpec;
42     }
43
44     @Override
45     public @Nullable String getMessage() {
46         return "Cannot parse '" + fullSpec + "' for datapoint '" + channelName + "': " + reason;
47     }
48 }