Package jsonvalues

Interface ImmutableMap

    • Method Detail

      • remove

        ImmutableMap remove​(String key)
        removes the key associated with this map. It will be called by the library only if the key exists
        Parameters:
        key - the given key
        Returns:
        a map with the key removed
      • update

        ImmutableMap update​(String key,
                            JsElem je)
        updates the element associated with the key with a new element. It will be called by the library only if the key exists,
        Parameters:
        key - the given key
        je - the new element
        Returns:
        a map with the key element updated
      • contains

        boolean contains​(String key)
        returns true if the map contains the key
        Parameters:
        key - the given key
        Returns:
        true if the map contains the key, false if not
      • keys

        Set<String> keys()
        returns the keys of this map
        Returns:
        set of keys
      • get

        JsElem get​(String key)
        return the element associated with the key. It will be called by the library only if the key exists, so an error can be thrown if it doesn't
        Parameters:
        key - the given key
        Returns:
        the element associated with the key or JsNothing if it doesn't exist
      • getOptional

        Optional<JsElem> getOptional​(String key)
        return the element associated with the key wrapped into an optional. It's called by the library without checking the existence of the key.
        Parameters:
        key - the given key
        Returns:
        the element associated with the key or Optional.empty() if it doesn't exist
      • head

        Map.Entry<String,​JsElem> head()
        an entry of this map. A map is unordered, so any element could be the head. It's only called by the library if the map is not empty.
        Returns:
        an entry of this map
      • isEmpty

        boolean isEmpty()
        returns true if this map is empty
        Returns:
        true if empty, false otherwise
      • size

        int size()
        returns the size of the map
        Returns:
        the size of the map
      • tail

        M tail​(String head)
        the tail of the map given a head. It's only called by the library if the map is not empty.
        Parameters:
        head - the element returned by head()
        Returns:
        the tail of the map given a head