]> git.basschouten.com Git - openhab-addons.git/blob
f536d800c1693589d97e79ed580371e5bc3d0758
[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.sleepiq.internal.api.dto;
14
15 /**
16  * The {@link PauseModeRequest} holds the request to pause the bed data collection.
17  *
18  * @author Mark Hilbush - Initial contribution
19  */
20 public class PauseModeRequest {
21     private String mode;
22
23     public String getMode() {
24         return mode;
25     }
26
27     public void setMode(String mode) {
28         this.mode = mode;
29     }
30
31     public PauseModeRequest withMode(String mode) {
32         setMode(mode);
33         return this;
34     }
35
36     @Override
37     public int hashCode() {
38         final int prime = 31;
39         int result = 1;
40         result = prime * result + ((mode == null) ? 0 : mode.hashCode());
41         return result;
42     }
43
44     @Override
45     public boolean equals(Object obj) {
46         if (this == obj) {
47             return true;
48         }
49         if (obj == null) {
50             return false;
51         }
52         if (!(obj instanceof PauseModeRequest)) {
53             return false;
54         }
55         PauseModeRequest other = (PauseModeRequest) obj;
56         if (mode == null) {
57             if (other.mode != null) {
58                 return false;
59             }
60         } else if (!mode.equals(other.mode)) {
61             return false;
62         }
63         return true;
64     }
65
66     @Override
67     public String toString() {
68         StringBuilder builder = new StringBuilder();
69         builder.append("SleepNumberRequest [mode=");
70         builder.append(mode);
71         builder.append("]");
72         return builder.toString();
73     }
74 }