Class ArrayString


  • @JsType(isNative=true,
            name="Array",
            namespace="<global>")
    public final class ArrayString
    extends Array
    Array object which maps the java script object.
    A simple wrapper around a homogeneous native array of string values.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • fromOrNull

        @JsOverlay
        public static ArrayString fromOrNull​(String... items)
        This method creates new array instance with a variable number of string arguments.
        Parameters:
        items - string items to create new array
        Returns:
        new array instance of strings or null if argument is null or length to 0
      • fromOrEmpty

        @JsOverlay
        public static ArrayString fromOrEmpty​(String... items)
        This method creates new array instance with a variable number of string arguments.
        Parameters:
        items - string items to create new array
        Returns:
        new array instance of strings or an empty array if argument is null or length to 0
      • fromOrNull

        @JsOverlay
        public static ArrayString fromOrNull​(List<String> items)
        Creates a java script array of strings starting from list of strings.
        Parameters:
        items - list of strings to load in the new java script array.
        Returns:
        new array instance of strings or null if argument is null or empty
      • fromOrEmpty

        @JsOverlay
        public static ArrayString fromOrEmpty​(List<String> items)
        Creates a java script array of strings starting from list of strings.
        Parameters:
        items - list of strings to load in the new java script array.
        Returns:
        new array instance of strings or an empty array if argument is null or empty
      • fromOrNull

        @JsOverlay
        public static ArrayString fromOrNull​(IsColor... items)
        Creates a java script array of strings starting from array of colors.
        Parameters:
        items - array of colors to load in the new java script array.
        Returns:
        new array instance of strings or null if argument is null or length to 0
      • fromOrEmpty

        @JsOverlay
        public static ArrayString fromOrEmpty​(IsColor... items)
        Creates a java script array of strings starting from array of colors.
        Parameters:
        items - array of colors to load in the new java script array.
        Returns:
        new array instance of strings or an mepty array if argument is null or length to 0
      • fromOrNull

        @JsOverlay
        public static ArrayString fromOrNull​(Key... items)
        Creates a java script array of strings starting from array of keys.
        Parameters:
        items - array of keys to load in the new java script array.
        Returns:
        new array instance of strings or null if argument is null or length to 0
      • fromOrNull

        @JsOverlay
        public static ArrayString fromOrNull​(boolean asSet,
                                             Key... items)
        Creates a java script array of strings starting from array of keys.
        Parameters:
        items - array of keys to load in the new java script array.
        asSet - if true, the array is build without duplicates, as a set
        Returns:
        new array instance of strings or null if argument is null or length to 0
      • fromOrEmpty

        @JsOverlay
        public static ArrayString fromOrEmpty​(Key... items)
        Creates a java script array of strings starting from array of keys.
        Parameters:
        items - array of keys to load in the new java script array.
        Returns:
        new array instance of strings or an empty array if argument is null or length to 0
      • fromOrEmpty

        @JsOverlay
        public static ArrayString fromOrEmpty​(boolean asSet,
                                              Key... items)
        Creates a java script array of strings starting from array of keys.
        Parameters:
        items - array of keys to load in the new java script array.
        asSet - if true, the array is build without duplicates, as a set
        Returns:
        new array instance of strings or an empty array if argument is null or length to 0
      • fromOrNull

        @JsOverlay
        public static <T extends KeyArrayString fromOrNull​(Set<T> items)
        Creates a java script array of strings starting from set of keys.
        Type Parameters:
        T - type of the key
        Parameters:
        items - set of keys to load in the new java script array.
        Returns:
        new array instance of strings or null if argument is null or empty
      • fromOrEmpty

        @JsOverlay
        public static <T extends KeyArrayString fromOrEmpty​(Set<T> items)
        Creates a java script array of strings starting from set of keys.
        Type Parameters:
        T - type of the key
        Parameters:
        items - set of keys to load in the new java script array.
        Returns:
        new array instance of strings or an empty array if argument is null or empty
      • get

        @JsOverlay
        public String get​(int index)
        Gets the value at a given index. If no value exists at the given index, a type-conversion error will occur in Development Mode and unpredictable behavior may occur in Production Mode. If the numeric value returned is non-integral, it will cause a warning in Development Mode, and may affect the results of mathematical expressions.
        Parameters:
        index - the index to be retrieved
        Returns:
        the value at the given index