Package org.uberfire.plugin
Class PluginUtil
- java.lang.Object
-
- org.uberfire.plugin.PluginUtil
-
public class PluginUtil extends Object
Utilities for working with external (GWT-compiled) plugins.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>ensureIterable(List<T> externalList)static <T> Set<T>ensureIterable(Set<T> externalSet)static IntegertoInteger(int value)Integeris not aJsTypeand can't be shared across scripts.
-
-
-
Method Detail
-
ensureIterable
public static <T> List<T> ensureIterable(List<T> externalList)
Listis aJsTypebutCollection.iterator()isJsIgnored and therefore not exported to JavaScript.This method takes a list and converts it to a new list so it can be iterated over in the current script (e.g. using enhanced for loops), even if the instance was provided by an external (GWT-compiled) script.
- Parameters:
externalList- A list, possibly provided by an external script. Must not be null.- Returns:
- an immutable list containing the original elements of the provided list
-
ensureIterable
public static <T> Set<T> ensureIterable(Set<T> externalSet)
Setis aJsTypebutCollection.iterator()isJsIgnored and therefore not exported to JavaScript.This method takes a set and converts it to a new set so it can be iterated over in the current script (e.g. using enhanced for loops), even if the instance was provided by an external (GWT-compiled) script.
- Parameters:
externalSet- A set, possibly provided by an external script. Must not be null.- Returns:
- an immutable set containing the original elements of the provided set
-
-