2 * Copyright (c) 2010-2021 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.satel.internal.util;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
19 * Replacement class for Apache's StringUtils.
21 * @author Krzysztof Goworek - Initial contribution
25 public class StringUtils {
28 * Checks if a string is empty or null.
30 * @param str the string to check
31 * @return <code>true</code> if given string is empty or null
33 public static boolean isEmpty(@Nullable String str) {
34 return str == null || str.isEmpty();
38 * Checks if a string is not empty and not null.
40 * @param str the string to check
41 * @return <code>true</code> if given string is not empty and not null
43 public static boolean isNotEmpty(@Nullable String str) {
48 * Checks if a string is null or empty or all characters are whitespace.
50 * @param str the string to check
51 * @return <code>true</code> if given string is blank
53 public static boolean isBlank(@Nullable String str) {
54 return str == null || str.isBlank();
58 * Checks if a string is not null, not empty and contains at least one non-whitespace character.
60 * @param str the string to check
61 * @return <code>true</code> if given string is not blank
63 public static boolean isNotBlank(@Nullable String str) {