Class SplitStringExtensions


  • public final class SplitStringExtensions
    extends java.lang.Object
    The class SplitStringExtensions provides methods for split string objects.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.commons.lang3.tuple.Triple<java.lang.String,​java.lang.String,​java.lang.String> getTripleFromMessage​(java.lang.String message)
      Splits the given message string into three parts and put them into a Triple object
      static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input)
      Splits the given input string into words and puts them to a counter map
      static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input, java.lang.String regex)
      Splits the given input string into words and puts them to a counter map
      static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input, java.lang.String[] findString)
      Splits the given input string into words and puts them to a counter map
      • Methods inherited from class java.lang.Object

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

      • splitToWordsAndCount

        public static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input)
        Splits the given input string into words and puts them to a counter map
        Parameters:
        input - The input string
        Returns:
        The map with the words and the count
      • splitToWordsAndCount

        public static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input,
                                                                                                   java.lang.String[] findString)
        Splits the given input string into words and puts them to a counter map
        Parameters:
        input - The input string
        findString - An array with search patterns.
        Returns:
        The map with the words and the count
      • splitToWordsAndCount

        public static java.util.Map<java.lang.String,​java.lang.Integer> splitToWordsAndCount​(java.lang.String input,
                                                                                                   java.lang.String regex)
        Splits the given input string into words and puts them to a counter map
        Parameters:
        input - The input string
        regex - The regex string that is used for splitting
        Returns:
        The map with the words and the count
      • getTripleFromMessage

        public static org.apache.commons.lang3.tuple.Triple<java.lang.String,​java.lang.String,​java.lang.String> getTripleFromMessage​(java.lang.String message)
        Splits the given message string into three parts and put them into a Triple object
        Parameters:
        message - The message string
        Returns:
        The splitted message in a Triple object