Class StringTools

java.lang.Object
com.bazaarvoice.jolt.utils.StringTools

public class StringTools extends 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 Details

    • StringTools

      public StringTools()
  • Method Details

    • countMatches

      public static int countMatches(CharSequence sourceSequence, 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(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(CharSequence sourceSequence)
      Check if a sequence is blank
      Parameters:
      sourceSequence - to check
      Returns:
      true is sourceSequence is blank
    • isEmpty

      public static boolean isEmpty(CharSequence sourceSequence)
      Check if a sequence is empty
      Parameters:
      sourceSequence - to check
      Returns:
      true if source is empty