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.sleepiq.internal.api.dto;
15 import com.google.gson.annotations.SerializedName;
18 * The {@link Error} holds the Error response from the sleepiq API.
20 * @author Gregory Moyer - Initial contribution
23 @SerializedName("Code")
25 @SerializedName("Message")
26 private String message;
28 public Long getCode() {
32 public void setCode(Long code) {
36 public Error withCode(Long code) {
41 public String getMessage() {
45 public void setMessage(String message) {
46 this.message = message;
49 public Error withMessage(String message) {
55 public int hashCode() {
58 result = prime * result + ((code == null) ? 0 : code.hashCode());
63 public boolean equals(Object obj) {
70 if (!(obj instanceof Error)) {
73 Error other = (Error) obj;
75 if (other.code != null) {
78 } else if (!code.equals(other.code)) {
85 public String toString() {
86 StringBuilder builder = new StringBuilder();
87 builder.append("Error [code=");
89 builder.append(", message=");
90 builder.append(message);
92 return builder.toString();