com.comtrade.ecm.engine.util

## Class StringUtils

- java.lang.Object
- - com.comtrade.ecm.engine.util.StringUtils

-     public class StringUtils
      extends java.lang.Object

  A collection of utility methods with String parameter(s).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `EMPTY_STRING` An empty String. Name of this parameter has been chosen carefully.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `hasLetters(java.lang.String text)` Returns an information about existence of (at least) one letter inside a text
    `static boolean` | `isBlank(java.lang.String text)`
    `static boolean` | `isEmpty(java.lang.CharSequence text)`
    `static boolean` | `isNotBlank(java.lang.String text)` Method created after a special request of Lazar Stefanović. He said that such a method would make his life much easier, so why shouldn't we make it?
    `static boolean` | `isNotEmpty(java.lang.String text)` Method created after a special request of Lazar Stefanović. He said that such a method would make his life much easier, so why shouldn't we make it?
    `static java.lang.String` | `join(java.util.Collection<java.lang.Object> collection, java.lang.String delimiter)` Joins collection of Strings into a single String.
    `static java.lang.String` | `lowercase(java.lang.String text)`
    `static java.lang.String` | `lowercaseFirst(java.lang.String text)`
    `static java.lang.String` | `removeFormattingCharacters(java.lang.String text)` Removes formatting characters from a String
    `static java.lang.String` | `removeSpaces(java.lang.String text)` Removes spaces (and only spaces) from a String. It DOES NOT work like `trim`! It removes ALL the spaces from the text, even middle ones.
    `static java.lang.String` | `removeWhitespaces(java.lang.String text)` Removes whitespace-characters from a String
    `static java.lang.String` | `replaceCharacter(java.lang.String text, char characterOld, char characterNew)`
    `static java.lang.String` | `toAscii(java.lang.String text)` Converts all String letters to ascii
    `static java.lang.String` | `toCamelNotation(java.lang.String text)`
    `static java.lang.String` | `toCyrillic(java.lang.String text)` Converts all String letters to cyrillic WARNING! This conversion is not unambiguous, and should be used "with disclaimer". Examples of unwanted results : "Kralj Petar I Karađorđević" : "Краљ Петар И Карађорђевић" "Luj XIV" : "Луј ХИВ" "nadživeti" : "наџивети"
    `static java.lang.String` | `toLatin(java.lang.String text)` Converts all String letters to latin
    `static java.lang.String` | `toPropertyName(java.lang.String text)`
    `static java.lang.String` | `toSnakeNotation(java.lang.String text)`
    `static java.lang.String` | `toSnakeNotationFromCamel(java.lang.String text)`
    `static java.lang.String` | `uppercase(java.lang.String text)`
    `static java.lang.String` | `uppercaseFirst(java.lang.String text)`

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

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

- - ### Field Detail

    - #### EMPTY_STRING

          public static final java.lang.String EMPTY_STRING

      An empty String.
      Name of this parameter has been chosen carefully. For instance, (a bad) name "NULLSTRING" could have implied that its value is `null`.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### isEmpty

          public static boolean isEmpty(java.lang.CharSequence text)

      Parameters:
        `text` - An object whose "emptiness" should be evaluated. Could be `null`.
      Returns:
        `true`, if the CharSequence is empty or `null`
        `false`, otherwise

             isEmpty(null)        = true
             isEmpty("")          = true
             isEmpty(" ")         = false
             isEmpty("\t\n")      = false
             isEmpty("something") = false

    - #### isBlank

          public static boolean isBlank(java.lang.String text)

      Parameters:
        `text` - An object whose "blankness" should be evaluated. Could be `null`.
      Returns:
        `true`, if the CharSequence is empty, `null` or filled only with whitespace-characters
        `false`, otherwise

             isBlank(null)            = true
             isBlank("")              = true
             isBlank("   ")           = true
             isBlank("\t  \n")        = true
             isBlank("something")     = false
             isBlank("  something  ") = false

    - #### isNotEmpty

          public static boolean isNotEmpty(java.lang.String text)

      Method created after a special request of Lazar Stefanović.
      He said that such a method would make his life much easier, so why shouldn't we make it?
      Parameters:
        `text` - Text that should be tested
      Returns:
        An information if a `text` is not empty

    - #### isNotBlank

          public static boolean isNotBlank(java.lang.String text)

      Method created after a special request of Lazar Stefanović.
      He said that such a method would make his life much easier, so why shouldn't we make it?
      Parameters:
        `text` - Text that should be tested
      Returns:
        An information if a `text` is not blank

    - #### removeSpaces

          public static java.lang.String removeSpaces(java.lang.String text)

      Removes spaces (and only spaces) from a String.
      It DOES NOT work like `trim`! It removes ALL the spaces from the text, even middle ones.
      Parameters:
        `text` - A text from which we should remove spaces.
      Returns:
        Original string without space-characters, if original String is not `null`
        `EMPTY_STRING`, if original String is `null`.

    - #### removeWhitespaces

          public static java.lang.String removeWhitespaces(java.lang.String text)

      Removes whitespace-characters from a String
      Parameters:
        `text` - A text from which we should remove whitespace-characters.
      Returns:
        Original string without whitespace-characters, or `EMPTY_STRING`, if original String is `null`.

    - #### hasLetters

          public static boolean hasLetters(java.lang.String text)

      Returns an information about existence of (at least) one letter inside a text
      Parameters:
        `text` - Text whose content we're inspecting
      Returns:
        true, if there is at least one letter inside a text
        false, otherwise

    - #### removeFormattingCharacters

          public static java.lang.String removeFormattingCharacters(java.lang.String text)

      Removes formatting characters from a String
      Parameters:
        `text` - A text from which we should remove formatting characters.
      Returns:
        Original string without formatting characters, or `EMPTY_STRING`, if original String is `null`.

    - #### toLatin

          public static java.lang.String toLatin(java.lang.String text)

      Converts all String letters to latin
      Parameters:
        `text` - Original text
      Returns:
        Text written in latin-letters

    - #### toAscii

          public static java.lang.String toAscii(java.lang.String text)

      Converts all String letters to ascii
      Parameters:
        `text` - Original text
      Returns:
        Text written in ascii-letters

    - #### toCyrillic

          public static java.lang.String toCyrillic(java.lang.String text)

      Converts all String letters to cyrillic WARNING! This conversion is not unambiguous, and should be used "with disclaimer".
      Examples of unwanted results :
      "Kralj Petar I Karađorđević" : "Краљ Петар И Карађорђевић"
      "Luj XIV" : "Луј ХИВ"
      "nadživeti" : "наџивети"
      Parameters:
        `text` - Original text
      Returns:
        Text written in cyrillic-letters

    - #### toPropertyName

          public static java.lang.String toPropertyName(java.lang.String text)

    - #### toCamelNotation

          public static java.lang.String toCamelNotation(java.lang.String text)

    - #### uppercase

          public static java.lang.String uppercase(java.lang.String text)

    - #### toSnakeNotation

          public static java.lang.String toSnakeNotation(java.lang.String text)

    - #### toSnakeNotationFromCamel

          public static java.lang.String toSnakeNotationFromCamel(java.lang.String text)

    - #### uppercaseFirst

          public static java.lang.String uppercaseFirst(java.lang.String text)

    - #### lowercaseFirst

          public static java.lang.String lowercaseFirst(java.lang.String text)

    - #### lowercase

          public static java.lang.String lowercase(java.lang.String text)

    - #### replaceCharacter

          public static java.lang.String replaceCharacter(java.lang.String text,
                                                          char characterOld,
                                                          char characterNew)

    - #### join

          public static java.lang.String join(java.util.Collection<java.lang.Object> collection,
                                              java.lang.String delimiter)

      Joins collection of Strings into a single String. `Null`-strings are skipped.
      Parameters:
        `collection` - Collection of String that should be joined
        `delimiter` - Delimiter that separates Strings. If `null`, then `EMPTY_STRING` is used as a delimiter.
      Returns:
        Single string, resulted from joining all non`null`-strings from a collection, delimited by given delimiter.