Package com.bazaarvoice.jolt.utils
Class StringTools
java.lang.Object
com.bazaarvoice.jolt.utils.StringTools
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic int
countMatches
(CharSequence sourceSequence, CharSequence subSequence) Count the num# of matches of subSequence in sourceSequencestatic boolean
isBlank
(CharSequence sourceSequence) Check if a sequence is blankstatic boolean
isEmpty
(CharSequence sourceSequence) Check if a sequence is emptystatic boolean
isNotBlank
(CharSequence sourceSequence) Check if a sequence is NOT blank
-
Constructor Details
-
StringTools
public StringTools()
-
-
Method Details
-
countMatches
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
Check if a sequence is NOT blank- Parameters:
sourceSequence
- to check- Returns:
- true if sourceSequence is NOT blank
-
isBlank
Check if a sequence is blank- Parameters:
sourceSequence
- to check- Returns:
- true is sourceSequence is blank
-
isEmpty
Check if a sequence is empty- Parameters:
sourceSequence
- to check- Returns:
- true if source is empty
-