[smartmeter] Remove org.apache.common (#14436)

Signed-off-by: lsiepel <leosiepel@gmail.com>
This commit is contained in:
lsiepel 2023-02-19 20:47:42 +01:00 committed by GitHub
parent 22ccde016d
commit 43232dae2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -25,7 +25,6 @@ import java.util.function.Supplier;
import javax.measure.Quantity;
import javax.measure.Unit;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.DefaultLocation;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.NonNullByDefault;
@ -101,7 +100,7 @@ public class SmartMeterHandler extends BaseThingHandler {
"Parameter 'port' is mandatory and must be configured");
} else {
byte[] pullSequence = config.initMessage == null ? null
: HexUtils.hexToBytes(StringUtils.deleteWhitespace(config.initMessage));
: HexUtils.hexToBytes(config.initMessage.replaceAll("\\s+", ""));
int baudrate = config.baudrate == null ? Baudrate.AUTO.getBaudrate()
: Baudrate.fromString(config.baudrate).getBaudrate();
this.conformity = config.conformity == null ? Conformity.NONE : Conformity.valueOf(config.conformity);

View File

@ -12,7 +12,6 @@
*/
package org.openhab.binding.smartmeter.internal.helper;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.io.transport.serial.SerialPort;
@ -66,7 +65,7 @@ public enum SerialParameter {
*/
public static SerialParameter fromString(String params) {
try {
return valueOf("_" + StringUtils.upperCase(params));
return valueOf("_" + params.toUpperCase());
} catch (IllegalArgumentException e) {
return SerialParameter._8N1;
}