Class Utils

java.lang.Object
org.exoplatform.portal.pom.config.Utils

public class Utils extends Object
  • Field Details

  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • join

      public static String join(String separator, String... strings)
      todo: move to common module
      Parameters:
      separator -
      strings -
      Returns:
    • join

      public static String join(String separator, List<String> strings)
    • split

      public static String[] split(String separator, String s)
      todo: move to common module
      Parameters:
      separator -
      s -
      Returns:
    • safeImmutableList

      public static <E> List<E> safeImmutableList(E... list)
    • safeImmutableList

      public static <E> List<E> safeImmutableList(List<E> list)
    • safeImmutableMap

      public static <K, V> Map<K,V> safeImmutableMap(Map<K,V> map)
    • split

      public static String[] split(String separator, int index, String s)
      Splits a string according to a string separator.
      The provided index defines the beginning of the splitted chunks in the returned array. The values from the beginning up to the value index - 1 will be null values.
      Parameters:
      separator - the string separator
      index - the index to which the chunks begin
      s - the string to split
      Returns:
      an array containing the splitted chunks plus extra leading pad
    • queryEscape

      public static String queryEscape(String s)
      Escape the provided string for being usable as a query litteral.
      Parameters:
      s - the string to escpae
      Returns:
      the escaped result