]> git.basschouten.com Git - openhab-addons.git/blob
629c40571e13af4ebf8ed6e6e52d938f137672b1
[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;
14
15 import java.net.URI;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18
19 /**
20  * This class represents configuration parameters for using {@link SleepIQ}.
21  *
22  * @author Gregory Moyer - Initial contribution
23  */
24 @NonNullByDefault
25 public class Configuration {
26     private String username = "";
27     private String password = "";
28
29     private URI baseUri = URI.create("https://api.sleepiq.sleepnumber.com");
30
31     /**
32      * Get the username on the account.
33      *
34      * @return the username
35      */
36     public String getUsername() {
37         return username;
38     }
39
40     /**
41      * Set the username on the account. This should be the username used to
42      * register with SleepIQ.
43      *
44      * @param username
45      *            the value to set
46      */
47     public void setUsername(String username) {
48         this.username = username;
49     }
50
51     /**
52      * Set the username on the account. This should be the username used to
53      * register with SleepIQ.
54      *
55      * @param username
56      *            the value to set
57      * @return this configuration instance
58      */
59     public Configuration withUsername(String username) {
60         setUsername(username);
61         return this;
62     }
63
64     /**
65      * Get the password on the account.
66      *
67      * @return the password
68      */
69     public String getPassword() {
70         return password;
71     }
72
73     /**
74      * Set the password on the account. This should be the password used to
75      * register with SleepIQ.
76      *
77      * @param password
78      *            the value to set
79      */
80     public void setPassword(String password) {
81         this.password = password;
82     }
83
84     /**
85      * Set the password on the account. This should be the password used to
86      * register with SleepIQ.
87      *
88      * @param password
89      *            the value to set
90      * @return this configuration instance
91      */
92     public Configuration withPassword(String password) {
93         setPassword(password);
94         return this;
95     }
96
97     /**
98      * Get the base URI of the SleepIQ cloud service.
99      *
100      * @return the base URI
101      */
102     public URI getBaseUri() {
103         return baseUri;
104     }
105
106     /**
107      * Set the base URI of the SleepIQ cloud service. It is unlikely that this
108      * will need to be changed from its default value.
109      *
110      * @param baseUri
111      *            the value to set
112      */
113     public void setBaseUri(URI baseUri) {
114         this.baseUri = baseUri;
115     }
116
117     /**
118      * Set the base URI of the SleepIQ cloud service. It is unlikely that this
119      * will need to be changed from its default value.
120      *
121      * @param baseUri
122      *            the value to set
123      * @return this configuration instance
124      */
125     public Configuration withBaseUri(URI baseUri) {
126         setBaseUri(baseUri);
127         return this;
128     }
129 }