]> git.basschouten.com Git - openhab-addons.git/blob
48d2b74fdc63460c6e2393689cdba1a6e088b560
[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.mybmw.internal.dto.network;
14
15 import org.openhab.binding.mybmw.internal.utils.Constants;
16 import org.openhab.binding.mybmw.internal.utils.Converter;
17
18 /**
19  * The {@link NetworkError} Data Transfer Object
20  *
21  * @author Bernd Weymann - Initial contribution
22  */
23 public class NetworkError {
24     public String url;
25     public int status;
26     public String reason;
27     public String params;
28
29     @Override
30     public String toString() {
31         return new StringBuilder(url).append(Constants.HYPHEN).append(status).append(Constants.HYPHEN).append(reason)
32                 .append(params).toString();
33     }
34
35     public String toJson() {
36         return Converter.getGson().toJson(this);
37     }
38 }