]> git.basschouten.com Git - openhab-addons.git/blob
3d28b8cae064c0e1e67b7db2c28940a05c7313dc
[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.tplinksmarthome.internal.model;
14
15 import com.google.gson.annotations.Expose;
16
17 /**
18  * Base class for responses containing the common error response fields.
19  * Only getter methods as the values are set by gson based on the retrieved json.
20  *
21  * @author Hilbrand Bouwkamp - Initial contribution
22  */
23 public class ErrorResponse implements HasErrorResponse {
24
25     @Expose(serialize = false)
26     private int errCode;
27     @Expose(serialize = false)
28     private String errMsg;
29
30     /**
31      * @return the error code
32      */
33     public int getErrorCode() {
34         return errCode;
35     }
36
37     /**
38      * @return the error message
39      */
40     public String getErrorMessage() {
41         return errMsg;
42     }
43
44     @Override
45     public ErrorResponse getErrorResponse() {
46         return this;
47     }
48
49     @Override
50     public String toString() {
51         return "{err_code:" + errCode + ", err_msg:'" + errMsg + "'}";
52     }
53 }