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 and Description
    --- | ---
    `static class` | `StringUtilities.JUSTIFY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringUtilities()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and 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 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 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

Copyright © 2004–2021 "Tigase, Inc.". All rights reserved.