Package tigase.util

## Class StringUtilities

- java.lang.Object
- - tigase.util.StringUtilities

-     public class StringUtilities
      extends java.lang.Object

  Class with string utilities, mostly helping with canonical representation of String
  Author:
    wojtek

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `StringUtilities.JUSTIFY` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `StringUtilities()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static boolean` | `checkIfArrayContainsString​(char[] data, char[] string)` |
    `static boolean` | `checkIfArrayContainsString​(char[] data, int fromIndex, char[] string)` |
    `static java.lang.String` | `convertNonPrintableCharactersToLiterals​(java.lang.String input)` |
    `static java.lang.String` | `convertNonPrintableCharactersToLiterals​(java.lang.String input, boolean maintainWhitespace)` |
    `static java.lang.String` | `intArrayToString​(int[] arr, java.lang.String separator)` | Concatenate all elements of input array inserting separator between each
    `static java.lang.String[]` | `internStringArray​(java.lang.String[] in)` | Process all strings of an array using .intern()
    `static java.lang.StringBuilder` | `padString​(java.lang.StringBuilder sb, java.lang.String text, int width)` |
    `static java.lang.StringBuilder` | `padString​(java.lang.StringBuilder sb, java.lang.String text, int width, java.lang.String leftBracket, java.lang.String rightBracket)` |
    `static java.lang.StringBuilder` | `padString​(java.lang.StringBuilder sb, java.lang.String text, StringUtilities.JUSTIFY justify, int width, char padChar, java.lang.String leftBracket, java.lang.String rightBracket)` |
    `static java.lang.StringBuilder` | `padStringToColumn​(java.lang.StringBuilder sb, java.lang.String text, StringUtilities.JUSTIFY justify, int column, char padChar, java.lang.String leftBracket, java.lang.String rightBracket)` |
    `static java.lang.String` | `stringArrayToString​(java.lang.String[] arr, java.lang.String separator)` | Concatenate all elements of input array inserting separator between each
    `static java.lang.String[]` | `stringToArrayOfString​(java.lang.String in, java.lang.String splitter)` | Split string into an Array of Strings using provided splitter, output array is interned

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StringUtilities

          public StringUtilities()

  - ### Method Detail

    - #### checkIfArrayContainsString

          public static boolean checkIfArrayContainsString​(char[] data,
                                                           char[] string)

    - #### checkIfArrayContainsString

          public static boolean checkIfArrayContainsString​(char[] data,
                                                           int fromIndex,
                                                           char[] string)

    - #### convertNonPrintableCharactersToLiterals

          public static java.lang.String convertNonPrintableCharactersToLiterals​(java.lang.String input)

    - #### convertNonPrintableCharactersToLiterals

          public static java.lang.String convertNonPrintableCharactersToLiterals​(java.lang.String input,
                                                                                 boolean maintainWhitespace)

    - #### intArrayToString

          public static java.lang.String intArrayToString​(int[] arr,
                                                          java.lang.String separator)

      Concatenate all elements of input array inserting separator between each
      Parameters:
        `arr` - an array to be concatenated
        `separator` - to be inserted between each element of array
      Returns:
        string representation of the array

    - #### internStringArray

          public static java.lang.String[] internStringArray​(java.lang.String[] in)

      Process all strings of an array using .intern()
      Parameters:
        `in` - array of Strings to be interned
      Returns:
        array of interned string

    - #### padString

          public static java.lang.StringBuilder padString​(java.lang.StringBuilder sb,
                                                          java.lang.String text,
                                                          int width)

    - #### padString

          public static java.lang.StringBuilder padString​(java.lang.StringBuilder sb,
                                                          java.lang.String text,
                                                          int width,
                                                          java.lang.String leftBracket,
                                                          java.lang.String rightBracket)

    - #### padString

          public static java.lang.StringBuilder padString​(java.lang.StringBuilder sb,
                                                          java.lang.String text,
                                                          StringUtilities.JUSTIFY justify,
                                                          int width,
                                                          char padChar,
                                                          java.lang.String leftBracket,
                                                          java.lang.String rightBracket)

    - #### padStringToColumn

          public static java.lang.StringBuilder padStringToColumn​(java.lang.StringBuilder sb,
                                                                  java.lang.String text,
                                                                  StringUtilities.JUSTIFY justify,
                                                                  int column,
                                                                  char padChar,
                                                                  java.lang.String leftBracket,
                                                                  java.lang.String rightBracket)

    - #### stringArrayToString

          public static java.lang.String stringArrayToString​(java.lang.String[] arr,
                                                             java.lang.String separator)

      Concatenate all elements of input array inserting separator between each
      Parameters:
        `arr` - an array to be concatenated
        `separator` - to be inserted between each element of array
      Returns:
        string representation of the array

    - #### stringToArrayOfString

          public static java.lang.String[] stringToArrayOfString​(java.lang.String in,
                                                                 java.lang.String splitter)

      Split string into an Array of Strings using provided splitter, output array is interned
      Parameters:
        `in` - String to be splited
        `splitter` - delimiter of items
      Returns:
        Arrays of interned Strings