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