Class JSListImpl<T>

    • Constructor Detail

      • JSListImpl

        public JSListImpl​(String type,
                          com.fasterxml.jackson.databind.JsonNode node)
    • Method Detail

      • store

        protected abstract void store​(T val)
        Parameters:
        val - external representation
      • fieldName

        protected abstract String fieldName​(T val)
        Parameters:
        val - external representation
        Returns:
        field name
      • convertToT

        protected abstract T convertToT​(String val)
        Parameters:
        val - json field name
        Returns:
        external representation
      • size

        public int size()
        Description copied from interface: JSList
        Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.
        Specified by:
        size in interface JSList<T>
        Returns:
        the number of elements in this list
      • get

        public List<T> get()
        Specified by:
        get in interface JSList<T>
        Returns:
        all the values or empty list
      • get

        public T get​(int index)
        Specified by:
        get in interface JSList<T>
        Parameters:
        index - of entry
        Returns:
        the value throws JsforjException if index out of bounds
      • add

        public void add​(T val)
        Specified by:
        add in interface JSList<T>
        Parameters:
        val - to be added to list
      • contains

        public boolean contains​(T val)
        Specified by:
        contains in interface JSList<T>
        Parameters:
        val - to be checked
        Returns:
        true if present in list
      • remove

        public void remove​(T val)
        Specified by:
        remove in interface JSList<T>
        Parameters:
        val - to remove throws JsforjException if index out of bounds