Class StringUtil

  • public class StringUtil
    extends Object
    • Method Detail

      • tokenStringToArray

        public static String[] tokenStringToArray​(String tokenizedString,
                                                  String token)
        Tokenize a string and return a String Array of the values seperated by the passed in token.
        tokenizedString - The string to parse. If this is null, null will be returned.
        token - The token used as a seperator. if this is null, the fill string will be returned in a 1 element array
        Array of Strings that were seperated by the token.
      • doesPathContainParentPathSegment

        public static boolean doesPathContainParentPathSegment​(String path)
        Does the path contain a path-segment that is "..".
        path - String
        boolean return true if path contains "..", else false.
      • main

        public static void main​(String[] args)
      • isEmpty

        public static boolean isEmpty​(String str)
      • getMapAsPrettyString

        public static String getMapAsPrettyString​(Map map)
        Returns the provided Map as a pretty string, using the system dependent new like character as the key-value pair separator, and ' -> ' as the individual key and value separator.
        map - the Map to be converted to a string
        a pretty String representation of the Map
      • trimStringMap

        public static Map<String,​String> trimStringMap​(Map<String,​String> map)
        Returns a map of String key-value pairs, in which each key and corresponding value has been trimmed of whitespace.
        map - the Map of String key-value pairs to be trimmed
        a trimmed String Map
      • trimStringList

        public static List<String> trimStringList​(List<String> list)
        Returns a List of Strings in which each String has been trimmed of whitespace.
        list - the List of Strings to be trimmed
        a trimmed List of Strings
      • trimToEmpty

        public static String trimToEmpty​(String string)
        Wrapper method around StringUtils.trim
        string - the String to be trimmed
        the trimmed String