Class 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 sourceSequence
      static boolean isBlank​(java.lang.CharSequence sourceSequence)
      Check if a sequence is blank
      static boolean isEmpty​(java.lang.CharSequence sourceSequence)
      Check if a sequence is empty
      static boolean isNotBlank​(java.lang.CharSequence sourceSequence)
      Check if a sequence is NOT blank
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringTools

        public StringTools()
    • 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 from
        subSequence - 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