Class Strings


  • public final class Strings
    extends 

    Expression Object for performing String-related operations inside Thymeleaf Standard Expressions.

    An object of this class is usually available in variable evaluation expressions with the name #strings.

    Since:
    1.0
    Author:
    Daniel Fernández, Bernard Le Roux
    • Constructor Summary

      Constructors 
      Constructor Description
       locale)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
       target, int maxSize)  
       target,  suffix)  
      [] [] target, int maxSize)  
      [] [] target,  suffix)  
      [] [] target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.
      [] [] target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
      [] [] target,  delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array.
      [] [] target,  fragment)  
      [] [] target,  fragment)  
      [] [] target,  defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      [] [] target,  suffix)  
      [] [] target)
      Java-escapes all the elements in the target array.
      [] [] target)
      JavaScript-escapes all the elements in the target array.
      [] [] target)
      XML-escapes all the elements in the target array.
      [] [] target,  fragment)  
      [] [] target)  
      [] stringArray,  separator)  
      [] [] target)  
      [] [] target, [] before, [] after)  
      [] [] target,  prefix)  
      [] [] target,  before,  after)  
      []  target,  separator)  
      [] [] target,  prefix)  
      [] [] target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target array.
      [] [] target, int start, int end)  
      [] [] target,  substr)  
      [] [] target,  substr)  
      [] [] target)  
      [] [] target)
      Performs a null-safe toString() operation on each element of the array.
      [] [] target)  
      [] [] target)  
      [] [] target)
      Convert the first letter into lowercase for all the elements in the target array.
      [] [] target)
      Java-unescapes all the elements in the target array.
      [] [] target)
      JavaScript-unescapes all the elements in the target array.
       target)
      Convert the first letter of target to uppercase (title-case, in fact).
       target)
      Convert the first letter of each words of target to uppercase (title-case, in fact).
       target,  delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.
      ... values)  
       nullValue, ... values)  
       target,  fragment)  
       target,  fragment)  
       target,  defaultValue)
      Checks if target text is empty and uses either target, or if the target is empty uses defaultValue.
       target,  suffix)  
       first,  second)  
       first,  second)  
       target)
      Java-escapes the specified text.
       target)
      JavaScript-escapes the specified text.
       target)
      XML-escapes the specified text.
       target,  fragment)  
       target)  
       target)  
      <> <?> target, int maxSize)  
      <> <?> target,  suffix)  
      <> <?> target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.
      <> <?> target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
      <> <?> target,  delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list.
      <> <?> target,  fragment)  
      <> <?> target,  fragment)  
      <> <?> target,  defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      <> <?> target,  suffix)  
      <> <?> target)
      Java-escapes all the elements in the target list.
      <> <?> target)
      JavaScript-escapes all the elements in the target list.
      <> <?> target)
      XML-escapes all the elements in the target list.
      <> <?> target,  fragment)  
      <> <?> target)  
      <?> stringIter,  separator)  
      <> <?> target)  
      <> <?> target, [] before, [] after)  
      <> <?> target,  prefix)  
      <> <?> target,  before,  after)  
      <>  target,  separator)  
      <> <?> target,  prefix)  
      <> <?> target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target list.
      <> <?> target, int start, int end)  
      <> <?> target,  substr)  
      <> <?> target,  substr)  
      <> <?> target)  
      <> <?> target)
      Performs a null-safe toString() operation on each element of the list.
      <> <?> target)  
      <> <?> target)  
      <> <?> target)
      Convert the first letter into lowercase for all the elements in the target list.
      <> <?> target)
      Java-unescapes all the elements in the target list.
      <> <?> target)
      JavaScript-unescapes all the elements in the target list.
       target, [] before, [] after)  
       target,  prefix)  
      randomAlphanumeric​(int count)
      Builds a random String using characters 0..9 and A..Z.
       target, int times)  
       target,  before,  after)  
      <> <?> target, int maxSize)  
      <> <?> target,  suffix)  
      <> <?> target)
      Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.
      <> <?> target)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
      <> <?> target,  delimiters)
      Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set.
      <> <?> target,  fragment)  
      <> <?> target,  fragment)  
      <> <?> target,  defaultValue)
      Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.
      <> <?> target,  suffix)  
      <> <?> target)
      Java-escapes all the elements in the target set.
      <> <?> target)
      JavaScript-escapes all the elements in the target set.
      <> <?> target)
      XML-escapes all the elements in the target set.
      <> <?> target,  fragment)  
      <> <?> target)  
      <?> stringIter,  separator)  
      <> <?> target)  
      <> <?> target, [] before, [] after)  
      <> <?> target,  prefix)  
      <> <?> target,  before,  after)  
      <>  target,  separator)  
      <> <?> target,  prefix)  
      <> <?> target, int start)
      copy a part of target start beginIndex to the end of target for all the elements in the target set.
      <> <?> target, int start, int end)  
      <> <?> target,  substr)  
      <> <?> target,  substr)  
      <> <?> target)  
      <> <?> target)
      Performs a null-safe toString() operation on each element of the set.
      <> <?> target)  
      <> <?> target)  
      <> <?> target)
      Convert the first letter into lowercase for all the elements in the target set.
      <> <?> target)
      Java-unescapes all the elements in the target set.
      <> <?> target)
      JavaScript-unescapes all the elements in the target set.
       target,  prefix)  
       target, int start)
      copy a part of target start beginIndex to the end of target.
       target, int start, int end)  
       target,  substr)  
       target,  substr)  
       target)  
       target)
      Performs a null-safe toString() operation.
       target)  
       target)  
       target)
      Convert the first letter of target to lowercase.
       target)
      Java-unescapes the specified text.
       target)
      JavaScript-unescapes the specified text.
      • Methods inherited from class java.lang.

        , , , , , , , , , ,
    • Constructor Detail

      • Strings

        public Strings​( locale)
    • Method Detail

      • toString

        public  toString​( target)

        Performs a null-safe toString() operation.

        Parameters:
        target - the object on which toString will be executed
        Returns:
        the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • arrayToString

        public [] arrayToString​([] target)

        Performs a null-safe toString() operation on each element of the array.

        Parameters:
        target - the array of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • listToString

        public <> listToString​(<?> target)

        Performs a null-safe toString() operation on each element of the list.

        Parameters:
        target - the list of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • setToString

        public <> setToString​(<?> target)

        Performs a null-safe toString() operation on each element of the set.

        Parameters:
        target - the set of objects on which toString will be executed
        Returns:
        for each element: the result of calling target.toString() if target is not null, null if target is null.
        Since:
        2.0.12
      • abbreviate

        public  abbreviate​( target,
                                 int maxSize)
      • arrayAbbreviate

        public [] arrayAbbreviate​([] target,
                                        int maxSize)
      • listAbbreviate

        public <> listAbbreviate​(<?> target,
                                           int maxSize)
      • setAbbreviate

        public <> setAbbreviate​(<?> target,
                                         int maxSize)
      • equals

        public  equals​( first,
                               second)
        Parameters:
        first - first
        second - second
        Returns:
        the result
        Since:
        2.0.16
      • equalsIgnoreCase

        public  equalsIgnoreCase​( first,
                                         second)
        Parameters:
        first - first
        second - second
        Returns:
        the result
        Since:
        2.0.16
      • contains

        public  contains​( target,
                                 fragment)
      • arrayContains

        public [] arrayContains​([] target,
                                        fragment)
      • listContains

        public <> listContains​(<?> target,
                                           fragment)
      • setContains

        public <> setContains​(<?> target,
                                         fragment)
      • containsIgnoreCase

        public  containsIgnoreCase​( target,
                                           fragment)
      • arrayContainsIgnoreCase

        public [] arrayContainsIgnoreCase​([] target,
                                                  fragment)
      • listContainsIgnoreCase

        public <> listContainsIgnoreCase​(<?> target,
                                                     fragment)
      • setContainsIgnoreCase

        public <> setContainsIgnoreCase​(<?> target,
                                                   fragment)
      • startsWith

        public  startsWith​( target,
                                   prefix)
      • arrayStartsWith

        public [] arrayStartsWith​([] target,
                                          prefix)
      • listStartsWith

        public <> listStartsWith​(<?> target,
                                             prefix)
      • setStartsWith

        public <> setStartsWith​(<?> target,
                                           prefix)
      • endsWith

        public  endsWith​( target,
                                 suffix)
      • arrayEndsWith

        public [] arrayEndsWith​([] target,
                                        suffix)
      • listEndsWith

        public <> listEndsWith​(<?> target,
                                           suffix)
      • setEndsWith

        public <> setEndsWith​(<?> target,
                                         suffix)
      • substring

        public  substring​( target,
                                int start,
                                int end)
      • arraySubstring

        public [] arraySubstring​([] target,
                                       int start,
                                       int end)
      • listSubstring

        public <> listSubstring​(<?> target,
                                          int start,
                                          int end)
      • setSubstring

        public <> setSubstring​(<?> target,
                                        int start,
                                        int end)
      • substring

        public  substring​( target,
                                int start)

        copy a part of target start beginIndex to the end of target. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • arraySubstring

        public [] arraySubstring​([] target,
                                       int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target array. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • listSubstring

        public <> listSubstring​(<?> target,
                                          int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target list. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • setSubstring

        public <> setSubstring​(<?> target,
                                        int start)

        copy a part of target start beginIndex to the end of target for all the elements in the target set. If non-String object, toString() will be called.

        Parameters:
        target - source of the copy.
        start - index where the copy start.
        Returns:
        part of target, or null if target is null.
        Since:
        1.1.2
      • substringAfter

        public  substringAfter​( target,
                                      substr)
      • arraySubstringAfter

        public [] arraySubstringAfter​([] target,
                                             substr)
      • listSubstringAfter

        public <> listSubstringAfter​(<?> target,
                                                substr)
      • setSubstringAfter

        public <> setSubstringAfter​(<?> target,
                                              substr)
      • substringBefore

        public  substringBefore​( target,
                                       substr)
      • arraySubstringBefore

        public [] arraySubstringBefore​([] target,
                                              substr)
      • listSubstringBefore

        public <> listSubstringBefore​(<?> target,
                                                 substr)
      • setSubstringBefore

        public <> setSubstringBefore​(<?> target,
                                               substr)
      • prepend

        public  prepend​( target,
                               prefix)
      • arrayPrepend

        public [] arrayPrepend​([] target,
                                      prefix)
      • listPrepend

        public <> listPrepend​(<?> target,
                                         prefix)
      • setPrepend

        public <> setPrepend​(<?> target,
                                       prefix)
      • repeat

        public  repeat​( target,
                             int times)
        Parameters:
        target - target
        times - times
        Returns:
        the result
        Since:
        2.1.0
      • append

        public  append​( target,
                              suffix)
      • concat

        public  concat​(... values)
        Parameters:
        values - values
        Returns:
        the result
        Since:
        2.0.16
      • concatReplaceNulls

        public  concatReplaceNulls​( nullValue,
                                         ... values)
        Parameters:
        nullValue - nullValue
        values - values
        Returns:
        the result
        Since:
        2.0.16
      • arrayAppend

        public [] arrayAppend​([] target,
                                     suffix)
      • listAppend

        public <> listAppend​(<?> target,
                                        suffix)
      • setAppend

        public <> setAppend​(<?> target,
                                      suffix)
      • indexOf

        public  indexOf​( target,
                                fragment)
      • arrayIndexOf

        public [] arrayIndexOf​([] target,
                                       fragment)
      • listIndexOf

        public <> listIndexOf​(<?> target,
                                          fragment)
      • setIndexOf

        public <> setIndexOf​(<?> target,
                                        fragment)
      • isEmpty

        public  isEmpty​( target)
      • arrayIsEmpty

        public [] arrayIsEmpty​([] target)
      • listIsEmpty

        public <> listIsEmpty​(<?> target)
      • setIsEmpty

        public <> setIsEmpty​(<?> target)
      • arrayJoin

        public  arrayJoin​([] stringArray,
                                 separator)
      • listJoin

        public  listJoin​(<?> stringIter,
                                separator)
      • setJoin

        public  setJoin​(<?> stringIter,
                               separator)
      • arraySplit

        public [] arraySplit​( target,
                                    separator)
      • listSplit

        public <> listSplit​( target,
                                       separator)
      • setSplit

        public <> setSplit​( target,
                                     separator)
      • length

        public  length​( target)
      • arrayLength

        public [] arrayLength​([] target)
      • listLength

        public <> listLength​(<?> target)
      • setLength

        public <> setLength​(<?> target)
      • replace

        public  replace​( target,
                               before,
                               after)
      • arrayReplace

        public [] arrayReplace​([] target,
                                      before,
                                      after)
      • listReplace

        public <> listReplace​(<?> target,
                                         before,
                                         after)
      • setReplace

        public <> setReplace​(<?> target,
                                       before,
                                       after)
      • multipleReplace

        public  multipleReplace​( target,
                                      [] before,
                                      [] after)
      • arrayMultipleReplace

        public [] arrayMultipleReplace​([] target,
                                             [] before,
                                             [] after)
      • listMultipleReplace

        public <> listMultipleReplace​(<?> target,
                                                [] before,
                                                [] after)
      • setMultipleReplace

        public <> setMultipleReplace​(<?> target,
                                              [] before,
                                              [] after)
      • toUpperCase

        public  toUpperCase​( target)
      • arrayToUpperCase

        public [] arrayToUpperCase​([] target)
      • listToUpperCase

        public <> listToUpperCase​(<?> target)
      • setToUpperCase

        public <> setToUpperCase​(<?> target)
      • toLowerCase

        public  toLowerCase​( target)
      • arrayToLowerCase

        public [] arrayToLowerCase​([] target)
      • listToLowerCase

        public <> listToLowerCase​(<?> target)
      • setToLowerCase

        public <> setToLowerCase​(<?> target)
      • trim

        public  trim​( target)
      • arrayTrim

        public [] arrayTrim​([] target)
      • listTrim

        public <> listTrim​(<?> target)
      • setTrim

        public <> setTrim​(<?> target)
      • capitalize

        public  capitalize​( target)

        Convert the first letter of target to uppercase (title-case, in fact).

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalize

        public [] arrayCapitalize​([] target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target array.

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalize

        public <> listCapitalize​(<?> target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target list.

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalize

        public <> setCapitalize​(<?> target)

        Convert the first letter into uppercase (title-case, in fact) for all the elements in the target set.

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • unCapitalize

        public  unCapitalize​( target)

        Convert the first letter of target to lowercase.

        Parameters:
        target - the String to be uncapitalized. If non-String object, toString() will be called.
        Returns:
        String the result of uncapitalizing the target.
        Since:
        1.1.2
      • arrayUnCapitalize

        public [] arrayUnCapitalize​([] target)

        Convert the first letter into lowercase for all the elements in the target array.

        Parameters:
        target - the array of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • listUnCapitalize

        public <> listUnCapitalize​(<?> target)

        Convert the first letter into lowercase for all the elements in the target list.

        Parameters:
        target - the list of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • setUnCapitalize

        public <> setUnCapitalize​(<?> target)

        Convert the first letter into lowercase for all the elements in the target set.

        Parameters:
        target - the set of Strings to be uncapitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of uncapitalizing each element of the target.
        Since:
        1.1.2
      • capitalizeWords

        public  capitalizeWords​( target)

        Convert the first letter of each words of target to uppercase (title-case, in fact). The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalizeWords

        public [] arrayCapitalizeWords​([] target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalizeWords

        public <> listCapitalizeWords​(<?> target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalizeWords

        public <> setCapitalizeWords​(<?> target)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The default delimiter characters between the words are the whitespace characters (see Characters.IsWhiteSpace method in the Java documentation).

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • capitalizeWords

        public  capitalizeWords​( target,
                                       delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact), using the specified delimiter chars for determining word ends/starts.

        Parameters:
        target - the String to be capitalized. If non-String object, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        String the result of capitalizing the target.
        Since:
        1.1.2
      • arrayCapitalizeWords

        public [] arrayCapitalizeWords​([] target,
                                              delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target array. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the array of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        a String[] with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • listCapitalizeWords

        public <> listCapitalizeWords​(<?> target,
                                                 delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target list. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the list of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString() will be called.
        Returns:
        a List with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • setCapitalizeWords

        public <> setCapitalizeWords​(<?> target,
                                               delimiters)

        Convert the first letter of each words of target to uppercase (title-case, in fact) for all the elements in the target set. The specified delimiter chars will be used for determining word ends/starts.

        Parameters:
        target - the set of Strings to be capitalized. If non-String objects, toString() will be called.
        delimiters - the delimiters of the words. If non-String object, toString()
        Returns:
        a Set with the result of capitalizing each element of the target.
        Since:
        1.1.2
      • escapeXml

        public  escapeXml​( target)

        XML-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.9
      • arrayEscapeXml

        public [] arrayEscapeXml​([] target)

        XML-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.9
      • listEscapeXml

        public <> listEscapeXml​(<?> target)

        XML-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.9
      • setEscapeXml

        public <> setEscapeXml​(<?> target)

        XML-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.9
      • escapeJavaScript

        public  escapeJavaScript​( target)

        JavaScript-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.11
      • arrayEscapeJavaScript

        public [] arrayEscapeJavaScript​([] target)

        JavaScript-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listEscapeJavaScript

        public <> listEscapeJavaScript​(<?> target)

        JavaScript-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setEscapeJavaScript

        public <> setEscapeJavaScript​(<?> target)

        JavaScript-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • unescapeJavaScript

        public  unescapeJavaScript​( target)

        JavaScript-unescapes the specified text.

        Parameters:
        target - the text to be unescaped
        Returns:
        the unescaped text.
        Since:
        2.0.11
      • arrayUnescapeJavaScript

        public [] arrayUnescapeJavaScript​([] target)

        JavaScript-unescapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listUnescapeJavaScript

        public <> listUnescapeJavaScript​(<?> target)

        JavaScript-unescapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setUnescapeJavaScript

        public <> setUnescapeJavaScript​(<?> target)

        JavaScript-unescapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • escapeJava

        public  escapeJava​( target)

        Java-escapes the specified text.

        Parameters:
        target - the text to be escaped
        Returns:
        the escaped text.
        Since:
        2.0.11
      • arrayEscapeJava

        public [] arrayEscapeJava​([] target)

        Java-escapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listEscapeJava

        public <> listEscapeJava​(<?> target)

        Java-escapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setEscapeJava

        public <> setEscapeJava​(<?> target)

        Java-escapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be escaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • unescapeJava

        public  unescapeJava​( target)

        Java-unescapes the specified text.

        Parameters:
        target - the text to be unescaped
        Returns:
        the unescaped text.
        Since:
        2.0.11
      • arrayUnescapeJava

        public [] arrayUnescapeJava​([] target)

        Java-unescapes all the elements in the target array.

        Parameters:
        target - the array of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of each each element of the target.
        Since:
        2.0.11
      • listUnescapeJava

        public <> listUnescapeJava​(<?> target)

        Java-unescapes all the elements in the target list.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a List with the result of each each element of the target.
        Since:
        2.0.11
      • setUnescapeJava

        public <> setUnescapeJava​(<?> target)

        Java-unescapes all the elements in the target set.

        Parameters:
        target - the list of Strings to be unescaped. If non-String objects, toString() will be called.
        Returns:
        a Set with the result of each each element of the target.
        Since:
        2.0.11
      • randomAlphanumeric

        public  randomAlphanumeric​(int count)

        Builds a random String using characters 0..9 and A..Z.

        Parameters:
        count - length of the generated String
        Returns:
        a random String
        Since:
        2.1.0
      • defaultString

        public  defaultString​( target,
                                     defaultValue)

        Checks if target text is empty and uses either target, or if the target is empty uses defaultValue.

        Parameters:
        target - value that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to use if target is empty If non-String objects, toString() will be called.
        Returns:
        either target, or if the target is empty defaultValue
        Since:
        2.1.3
      • arrayDefaultString

        public [] arrayDefaultString​([] target,
                                            defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the array of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a String[] with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3
      • listDefaultString

        public <> listDefaultString​(<?> target,
                                               defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the list of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a List<String> with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3
      • setDefaultString

        public <> setDefaultString​(<?> target,
                                             defaultValue)

        Checks if each target element is empty and uses either target element, or if the target element is empty uses defaultValue.

        Parameters:
        target - the set of values that to be checked if is null or empty If non-String objects, toString() will be called.
        defaultValue - value to return if target is empty If non-String objects, toString() will be called.
        Returns:
        a Set<String> with the result of defaultString(Object, Object) for each element of the target.
        Since:
        2.1.3