Package com.bazaarvoice.jolt.utils
Class StringTools
- java.lang.Object
-
- com.bazaarvoice.jolt.utils.StringTools
-
public class StringTools extends java.lang.Object
This class mimics the behavior of apache StringTools, except that it works on CharSequence instead of String Also, with this, jolt-core can finally be free of apache-common dependency
-
-
Constructor Summary
Constructors Constructor Description StringTools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
countMatches(java.lang.CharSequence sourceSequence, java.lang.CharSequence subSequence)
Count the num# of matches of subSequence in sourceSequencestatic boolean
isBlank(java.lang.CharSequence sourceSequence)
Check if a sequence is blankstatic boolean
isEmpty(java.lang.CharSequence sourceSequence)
Check if a sequence is emptystatic boolean
isNotBlank(java.lang.CharSequence sourceSequence)
Check if a sequence is NOT blank
-
-
-
Method Detail
-
countMatches
public static int countMatches(java.lang.CharSequence sourceSequence, java.lang.CharSequence subSequence)
Count the num# of matches of subSequence in sourceSequence- Parameters:
sourceSequence
- to find occurrence fromsubSequence
- to find occurrence of- Returns:
- num of occurrences of subSequence in sourceSequence
-
isNotBlank
public static boolean isNotBlank(java.lang.CharSequence sourceSequence)
Check if a sequence is NOT blank- Parameters:
sourceSequence
- to check- Returns:
- true if sourceSequence is NOT blank
-
isBlank
public static boolean isBlank(java.lang.CharSequence sourceSequence)
Check if a sequence is blank- Parameters:
sourceSequence
- to check- Returns:
- true is sourceSequence is blank
-
isEmpty
public static boolean isEmpty(java.lang.CharSequence sourceSequence)
Check if a sequence is empty- Parameters:
sourceSequence
- to check- Returns:
- true if source is empty
-
-