Class OptionsList<E>

    • Constructor Detail

      • OptionsList

        public OptionsList()
        Constructs an empty list.
      • OptionsList

        public OptionsList​(Collection<? extends E> c)
        Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
        Parameters:
        c - the collection whose elements are to be placed into this list
        Throws:
        NullPointerException - if the specified collection is null
    • Method Detail

      • getParent

        public org.zkoss.json.JSONAware getParent()
        Returns the parent options either OptionsMap or OptionsList. If null, that means the option is root object.
      • append

        public OptionsList<E> append​(Object value)
        Adds the value into the list.
        Returns:
        the instance itself.
      • addNestedList

        public OptionsList<Object> addNestedList​(Object... values)
        Adds to create a nested options list with the given values.
        Returns:
        a nested options list
      • addNestedMap

        public OptionsMap<String,​Object> addNestedMap​(Object... pairs)
        Adds to create a nested options map with the given key and value pairs.
        Returns:
        a nested options map
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.zkoss.json.JSONAware