Class FormValuesMap

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<String,​ArrayList<String>>

    public class FormValuesMap
    extends HashMap<String,​ArrayList<String>>
    Represents a collection of values to submit to the FormEngine. Values are ordered by key and for each key there can be multiple values. This is essentially a multimap extended with a few convenience methods for easy interacting. Apart from those form values, this class also contains a Map of uploaded files. Note that this class is not threadsafe!
    See Also:
    Serialized Form
    • Constructor Detail

      • FormValuesMap

        public FormValuesMap()
    • Method Detail

      • getValue

        public String getValue​(String key)
        Returns a single value.
        Parameters:
        key - the key to return the value for
        Returns:
        The first value found or null if it can't be found.
      • getValues

        public List<String> getValues​(String key)
        Returns a list containing all values for the specified key.
        Parameters:
        key - the key to return the values for
        Returns:
        a list containing all values for the specified key
      • addValue

        public void addValue​(String key,
                             String value)
        Adds a value for a key. This method may be invoked several times for a single key.
        Parameters:
        key - the key to add a values for
        value - the value to which the key belongs.
      • getUploadedFile

        @Deprecated
        public UploadedFile getUploadedFile​(String key)
        Deprecated.
        This method is deprecated since 10.33.0. Use getUploadedFiles(java.lang.String) instead.
        Returns the uploaded file with the specified key.
        Parameters:
        key - the key to the uploaded file
        Returns:
        the uploaded file with the specified key
      • getUploadedFiles

        public List<UploadedFile> getUploadedFiles​(String key)
        Returns the uploaded files with the specified key.
        Parameters:
        key - the key to the uploaded files
        Returns:
        the uploaded files with the specified key
        Since:
        10.33.0
      • addUploadedFile

        public void addUploadedFile​(String key,
                                    UploadedFile uploadedFile)
        Adds an uploaded file with the specified key.
        Parameters:
        key - the key to the file
        uploadedFile - the file that is uploaded