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 Failure} holds the Failure response from the sleepiq API.
20 * @author Gregory Moyer - Initial contribution
22 public class Failure {
23 @SerializedName("Error")
26 public Error getError() {
30 public void setError(Error error) {
34 public Failure withError(Error error) {
40 public int hashCode() {
43 result = prime * result + ((error == null) ? 0 : error.hashCode());
48 public boolean equals(Object obj) {
55 if (!(obj instanceof Failure)) {
58 Failure other = (Failure) obj;
60 if (other.error != null) {
63 } else if (!error.equals(other.error)) {
70 public String toString() {
71 StringBuilder builder = new StringBuilder();
72 builder.append("Failure [error=");
73 builder.append(error);
75 return builder.toString();