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
|
|
|
}
|
|
|
|
}
|
|
|
|
|