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:
Wouter Born
2021-03-16 12:38:16 +01:00
committed by GitHub
parent 16fba31556
commit f3503430b4
257 changed files with 906 additions and 1125 deletions

View File

@@ -12,8 +12,6 @@
*/
package org.openhab.binding.bigassfan.internal;
import org.apache.commons.lang.StringUtils;
/**
* The {@link BigAssFanConfig} is responsible for storing the BigAssFan thing configuration.
*
@@ -60,13 +58,13 @@ public class BigAssFanConfig {
}
public boolean isValid() {
if (StringUtils.isBlank(label)) {
if (label == null || label.isBlank()) {
return false;
}
if (StringUtils.isBlank(ipAddress)) {
if (ipAddress == null || ipAddress.isBlank()) {
return false;
}
if (StringUtils.isBlank(macAddress)) {
if (macAddress == null || macAddress.isBlank()) {
return false;
}
return true;

View File

@@ -40,7 +40,6 @@ import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.commons.lang.StringUtils;
import org.openhab.binding.bigassfan.internal.BigAssFanConfig;
import org.openhab.binding.bigassfan.internal.utils.BigAssFanConverter;
import org.openhab.core.common.ThreadPoolManager;
@@ -668,7 +667,7 @@ public class BigAssFanHandler extends BaseThingHandler {
}
private void processMessage(String incomingMessage) {
if (StringUtils.isEmpty(incomingMessage)) {
if (incomingMessage == null || incomingMessage.isEmpty()) {
return;
}
@@ -742,11 +741,11 @@ public class BigAssFanHandler extends BaseThingHandler {
private boolean isMe(String idFromDevice) {
// Check match on MAC address
if (StringUtils.equalsIgnoreCase(idFromDevice, macAddress)) {
if (macAddress.equalsIgnoreCase(idFromDevice)) {
return true;
}
// Didn't match MAC address, check match for label
if (StringUtils.equalsIgnoreCase(idFromDevice, label)) {
if (label.equalsIgnoreCase(idFromDevice)) {
return true;
}
return false;