2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.robonect.internal.model;
15 import com.google.gson.annotations.SerializedName;
18 * The super class of all answers from the robonect module. All answersd derive from this class. An answer is either
19 * successful where all the information of the subclass will be filled, or it is not successful, and this class will
20 * hold the error information.
22 * @author Marco Meyer - Initial contribution
24 public class RobonectAnswer {
26 private boolean successful;
28 @SerializedName("error_code")
29 private Integer errorCode;
31 @SerializedName("error_message")
32 private String errorMessage;
35 * @return - true if the request was successful, false otherwise.
37 public boolean isSuccessful() {
42 * allows to set the successful status for testing.
46 public void setSuccessful(boolean successful) {
47 this.successful = successful;
51 * @return - in case of a not successful request, the error code, null otherwise.
53 public Integer getErrorCode() {
58 * @return - in case of a not successful request, the error message, null otherwise.
60 public String getErrorMessage() {