Package tigase.util

# Class StringUtilities

java.lang.Object
tigase.util.StringUtilities

public class StringUtilities extends 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 enum`
  `StringUtilities.JUSTIFY`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StringUtilities()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `checkIfArrayContainsString(char[] data, char[] string)`
  `static boolean`
  `checkIfArrayContainsString(char[] data, int fromIndex, char[] string)`
  `static String`
  `convertNonPrintableCharactersToLiterals(String input)`
  `static String`
  `convertNonPrintableCharactersToLiterals(String input, boolean maintainWhitespace)`
  `static String`
  `intArrayToString(int[] arr, String separator)`
  Concatenate all elements of input array inserting separator between each
  `static String[]`
  `internStringArray(String[] in)`
  Process all strings of an array using .intern()
  `static StringBuilder`
  `padString(StringBuilder sb, String text, int width)`
  `static StringBuilder`
  `padString(StringBuilder sb, String text, int width, String leftBracket, String rightBracket)`
  `static StringBuilder`
  `padString(StringBuilder sb, String text, StringUtilities.JUSTIFY justify, int width, char padChar, String leftBracket, String rightBracket)`
  `static StringBuilder`
  `padStringToColumn(StringBuilder sb, String text, StringUtilities.JUSTIFY justify, int column, char padChar, String leftBracket, String rightBracket)`
  `static String`
  `stringArrayToString(String[] arr, String separator)`
  Concatenate all elements of input array inserting separator between each
  `static String[]`
  `stringToArrayOfString(String in, 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 Details

  - ### StringUtilities

    public StringUtilities()

- ## Method Details

  - ### checkIfArrayContainsString

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

  - ### checkIfArrayContainsString

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

  - ### convertNonPrintableCharactersToLiterals

    public static String convertNonPrintableCharactersToLiterals(String input)

  - ### convertNonPrintableCharactersToLiterals

    public static String convertNonPrintableCharactersToLiterals(String input, boolean maintainWhitespace)

  - ### intArrayToString

    public static String intArrayToString(int[] arr, 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 String[] internStringArray(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 StringBuilder padString(StringBuilder sb, String text, int width)

  - ### padString

    public static StringBuilder padString(StringBuilder sb, String text, int width, String leftBracket, String rightBracket)

  - ### padString

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

  - ### padStringToColumn

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

  - ### stringArrayToString

    public static String stringArrayToString(String[] arr, 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 String[] stringToArrayOfString(String in, 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