android-calculatorpp/src/org/solovyev/util/StringUtils.java

18 lines
408 B
Java
Raw Normal View History

2011-06-23 17:09:13 -04:00
package org.solovyev.util;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class StringUtils {
2011-09-10 14:20:58 -04:00
public static boolean isEmpty ( @Nullable CharSequence s ){
2011-06-23 17:09:13 -04:00
return s == null || s.length() == 0;
}
@NotNull
2011-09-10 14:20:58 -04:00
public static String getNotEmpty ( @Nullable CharSequence s, @NotNull String defaultValue ){
return isEmpty(s) ? defaultValue : s.toString();
2011-06-23 17:09:13 -04:00
}
}