java.lang.Object
org.eclipse.tracecompass.incubator.scripting.core.utils.UtilsModule

public class UtilsModule extends Object
A utility scripting module that wraps certain classes in more convenient objects. Script developers should try to use the wrapped class directly first as it may not be problematic in some cases and if there are execution problems when running the script, use the wrapper instead.
Author:
Geneviève Bastien
  • Constructor Details

    • UtilsModule

      public UtilsModule()
  • Method Details

    • createListWrapper

      public <T> ListWrapper<T> createListWrapper()
      Create a new list wrapper. Useful when passing Function classes to module methods where the function return value is a List. Some scripting engines do not handle very well those objects.
      Type Parameters:
      T - The type of elements that will be in the list
      Returns:
      The ListWrapper object with an empty list
    • strToArray

      public String[] strToArray(String string)
      Convert a string to an array of string, as some scripting languages do not easily support arrays (like jython)
      Parameters:
      string - The element to add to the array
      Returns:
      An array of string containing the element in parameter