public interface IStringUtil
Define common String operations
- Since:
- 1.0.0
- Version:
- 1.0.0
- Author:
- yui-KITAMURA
-
Method Summary
Modifier and TypeMethodDescriptionconcat
(CharSequence... arg) concat
(Iterable<? extends CharSequence> arg) get joined stringconcatWithDelimiter
(CharSequence delimiter, CharSequence... arg) concatWithDelimiter
(CharSequence delimiter, Iterable<? extends CharSequence> arg) get joined string that each separated with delimiterboolean
test the two objects String value are equal.boolean
test the two strings are equal.boolean
test the two objects String value are equal in Case-sensitive.boolean
test the two strings are equal in Case-sensitive.boolean
Check the objects string representation is empty.boolean
Check the value is empty.nullToEmpty
(String value) if the value is null then return""
(Empty string)
-
Method Details
-
eq
@Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean eq(String first, String second) test the two strings are equal.null
-safe- See Also:
-
eqCase
@Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean eqCase(String first, String second) test the two strings are equal in Case-sensitive.null
-safe- See Also:
-
eq
@Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean eq(Object first, Object second) test the two objects String value are equal.- Parameters:
first
- first object to be string valuesecond
- second object to be string value- Returns:
- if two string value are same then
true
- See Also:
-
eqCase
@Contract("null,null -> true; null,!null -> false; !null,null -> false; _,_ -> _") boolean eqCase(Object first, Object second) test the two objects String value are equal in Case-sensitive.- Parameters:
first
- first object to be string valuesecond
- second object to be string value- Returns:
- if two string value are same then
true
- See Also:
-
concat
get joined string- Parameters:
arg
- any list or arrays to concat- Returns:
- single string value that joined all arguments
-
concat
- See Also:
-
concatWithDelimiter
@Contract("_,_ -> new") String concatWithDelimiter(CharSequence delimiter, Iterable<? extends CharSequence> arg) get joined string that each separated with delimiter- Parameters:
delimiter
- joint string. ifnull
then one-spacearg
- any list or arrays to concat- Returns:
- single string value that joined all arguments each separated with delimiter
-
concatWithDelimiter
-
isEmpty
Check the value is empty.- Parameters:
value
- the value that you want to test- Returns:
- if
null
or length is 0 thentrue
, otherwisefalse
-
isEmpty
Check the objects string representation is empty.- Parameters:
obj
- the object that you want to test- Returns:
true
when null or theObject.toString()
value is empty- See Also:
-
StringUtils.isEmpty(String)
-
nullToEmpty
if the value is null then return""
(Empty string)- Parameters:
value
- the String object or null value- Returns:
- if the value is
null
then empty string(""
). Other case, same as original value
-