| /******************************************************************************* |
| * Copyright (c) 2008 xored software, Inc. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * xored software, Inc. - initial API and Implementation (Alex Panchenko) |
| *******************************************************************************/ |
| package org.eclipse.dltk.internal.debug.core.model; |
| |
| public class StrUtils { |
| |
| public static boolean equals(String s1, String s2) { |
| return s1 == null ? s2 == null : s1.equals(s2); |
| } |
| |
| public static boolean isEmpty(String str) { |
| return str == null || str.length() == 0; |
| } |
| |
| public static boolean isNotEmpty(String str) { |
| return str != null && str.length() != 0; |
| } |
| |
| public static boolean isBlank(String str) { |
| if (str == null) { |
| return true; |
| } |
| final int strLen = str.length(); |
| if (strLen == 0) { |
| return true; |
| } |
| for (int i = 0; i < strLen; i++) { |
| if ((Character.isWhitespace(str.charAt(i)) == false)) { |
| return false; |
| } |
| } |
| return true; |
| } |
| } |