new interface implementation

This commit is contained in:
serso
2011-09-10 22:20:58 +04:00
parent 0063f193ff
commit 32941504d9
15 changed files with 808 additions and 190 deletions

View File

@@ -5,13 +5,13 @@ import org.jetbrains.annotations.Nullable;
public class StringUtils {
public static boolean isEmpty ( @Nullable String s ){
public static boolean isEmpty ( @Nullable CharSequence s ){
return s == null || s.length() == 0;
}
@NotNull
public static String getNotEmpty ( @Nullable String s, @NotNull String defaultValue ){
return isEmpty(s) ? defaultValue : s;
public static String getNotEmpty ( @Nullable CharSequence s, @NotNull String defaultValue ){
return isEmpty(s) ? defaultValue : s.toString();
}
}