Rework more commons-lang usages (#10314)
* Reworks many commons-lang usages to use standard Java * Updates all remaining commons.lang imports to commons.lang3 Related to openhab/openhab-addons#7722 Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -12,17 +12,20 @@
|
||||
*/
|
||||
package org.openhab.binding.sleepiq.internal.config;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
|
||||
/**
|
||||
* Configuration class for the SleepIQ cloud.
|
||||
*
|
||||
* @author Gregory Moyer - Initial contribution
|
||||
*/
|
||||
@NonNullByDefault
|
||||
public class SleepIQCloudConfiguration {
|
||||
public static final String USERNAME = "username";
|
||||
public static final String PASSWORD = "password";
|
||||
public static final String POLLING_INTERVAL = "pollingInterval";
|
||||
|
||||
public String username;
|
||||
public String password;
|
||||
public String username = "";
|
||||
public String password = "";
|
||||
public int pollingInterval;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.openhab.binding.sleepiq.api.Configuration;
|
||||
import org.openhab.binding.sleepiq.api.LoginException;
|
||||
import org.openhab.binding.sleepiq.api.SleepIQ;
|
||||
@@ -214,12 +213,12 @@ public class SleepIQCloudHandler extends ConfigStatusBridgeHandler {
|
||||
String username = config.username;
|
||||
String password = config.password;
|
||||
|
||||
if (StringUtils.isEmpty(username)) {
|
||||
if (username.isEmpty()) {
|
||||
configStatusMessages.add(ConfigStatusMessage.Builder.error(USERNAME)
|
||||
.withMessageKeySuffix(SleepIQConfigStatusMessage.USERNAME_MISSING).withArguments(USERNAME).build());
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(password)) {
|
||||
if (password.isEmpty()) {
|
||||
configStatusMessages.add(ConfigStatusMessage.Builder.error(PASSWORD)
|
||||
.withMessageKeySuffix(SleepIQConfigStatusMessage.PASSWORD_MISSING).withArguments(PASSWORD).build());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user