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;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * This class represents configuration parameters for using {@link SleepIQ}.
22 * @author Gregory Moyer - Initial contribution
25 public class Configuration {
26 private String username = "";
27 private String password = "";
29 private URI baseUri = URI.create("https://api.sleepiq.sleepnumber.com");
31 private boolean logging = false;
34 * Get the username on the account.
36 * @return the username
38 public String getUsername() {
43 * Set the username on the account. This should be the username used to
44 * register with SleepIQ.
49 public void setUsername(String username) {
50 this.username = username;
54 * Set the username on the account. This should be the username used to
55 * register with SleepIQ.
59 * @return this configuration instance
61 public Configuration withUsername(String username) {
62 setUsername(username);
67 * Get the password on the account.
69 * @return the password
71 public String getPassword() {
76 * Set the password on the account. This should be the password used to
77 * register with SleepIQ.
82 public void setPassword(String password) {
83 this.password = password;
87 * Set the password on the account. This should be the password used to
88 * register with SleepIQ.
92 * @return this configuration instance
94 public Configuration withPassword(String password) {
95 setPassword(password);
100 * Get the base URI of the SleepIQ cloud service.
102 * @return the base URI
104 public URI getBaseUri() {
109 * Set the base URI of the SleepIQ cloud service. It is unlikely that this
110 * will need to be changed from its default value.
115 public void setBaseUri(URI baseUri) {
116 this.baseUri = baseUri;
120 * Set the base URI of the SleepIQ cloud service. It is unlikely that this
121 * will need to be changed from its default value.
125 * @return this configuration instance
127 public Configuration withBaseUri(URI baseUri) {
133 * Get the logging flag.
135 * @return the logging flag
137 public boolean isLogging() {
142 * Set the logging flag. When this is set to <code>true</code>, all requests
143 * and responses will be logged at the {@link Level#INFO} level. <b>This
144 * includes usernames and passwords!</b>
149 public void setLogging(boolean logging) {
150 this.logging = logging;
154 * Set the logging flag. When this is set to <code>true</code>, all requests
155 * and responses will be logged at the {@link Level#INFO} level. <b>This
156 * includes usernames and passwords!</b>
160 * @return this configuration instance
162 public Configuration withLogging(boolean logging) {