]> git.basschouten.com Git - openhab-addons.git/blob
e81ab178332e0d8df2ea86d3761f14b2b7b6723b
[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.boschshc.internal.services.dto;
14
15 /**
16  * Generic error response of the Bosch REST API.
17  * 
18  * @author Christian Oeing - Initial contribution
19  */
20 public class JsonRestExceptionResponse extends BoschSHCServiceState {
21
22     /**
23      * The entity could not be found. One of the defined path parameters was invalid.
24      */
25     public static final String ENTITY_NOT_FOUND = "ENTITY_NOT_FOUND";
26
27     public JsonRestExceptionResponse() {
28         super("JsonRestExceptionResponseEntity");
29         this.errorCode = "";
30         this.statusCode = 0;
31     }
32
33     /**
34      * The error code of the occurred Exception.
35      */
36     public String errorCode;
37
38     /**
39      * The HTTP status of the error.
40      */
41     public Integer statusCode;
42
43     public static boolean isValid(JsonRestExceptionResponse obj) {
44         return obj != null && obj.errorCode != null && obj.statusCode != null;
45     }
46 }