org.appng.forms

## Interface RequestContainer

- All Known Subinterfaces:
    Request, Request
  All Known Implementing Classes:
    ApplicationRequest, RequestBean

      public interface RequestContainer

  A `RequestContainer` conveniently wraps an `ServletRequest` and simplifies the access to (possibly multi-valued) request-parameters including `FormUpload`s.
  Author:
    Matthias Müller

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,List<FormUpload>>` | `getFormUploads()` Returns all `FormUpload`s for the request as immutable map.
    `List<FormUpload>` | `getFormUploads(String name)` Returns an immutable `List` of all `FormUpload`s for the parameter with the given name.
    `String` | `getHost()` Returns the host name for this request
    `String` | `getParameter(String name)` Returns the value for the parameter with the given name. Note that for a multi-valued parameter, any of the submitted values is returned.
    `List<String>` | `getParameterList(String name)` Returns a `List` containing all the values for the parameter with the given name.
    `Set<String>` | `getParameterNames()` Returns an immutable `Set` containing the names of all request parameters.
    `Map<String,String>` | `getParameters()` Returns an immutable `Map` containing the name of each request-parameter as a key and a single parameter value as the map's value. Note that for multi-valued parameters, the returned map contains any of the submitted values.
    `Map<String,List<String>>` | `getParametersList()` Returns an immutable `Map` containing the name of each request-parameter as a key and the list of submitted values as value.
    `boolean` | `hasParameter(String name)` Checks whether a parameter with the given name exists.

- - ### Method Detail

    - #### getHost

          String getHost()

      Returns the host name for this request
      Returns:
        the host name

    - #### getParametersList

          Map<String,List<String>> getParametersList()

      Returns an immutable `Map` containing the name of each request-parameter as a key and the list of submitted values as value.
      Returns:
        a `Map` containing the request parameters (including multi-valued ones)

    - #### getParameters

          Map<String,String> getParameters()

      Returns an immutable `Map` containing the name of each request-parameter as a key and a single parameter value as the map's value.
      Note that for multi-valued parameters, the returned map contains any of the submitted values. Use `getParametersList()` instead if you want to deal with multi-valued parameters.
      Returns:
        a `Map` containing the request parameters

    - #### getParameter

          String getParameter(String name)

      Returns the value for the parameter with the given name.
      Note that for a multi-valued parameter, any of the submitted values is returned. Use `getParameterList(String)` instead if you want to deal with a multi-valued parameter.
      Parameters:
        `name` - the name of the parameter
      Returns:
        the value of the parameter (may be null)

    - #### getParameterNames

          Set<String> getParameterNames()

      Returns an immutable `Set` containing the names of all request parameters.
      Returns:
        the parameters names

    - #### hasParameter

          boolean hasParameter(String name)

      Checks whether a parameter with the given name exists.
      Parameters:
        `name` - the name of the parameter
      Returns:
        `true` if such a parameter exists, `false` otherwise

    - #### getParameterList

          List<String> getParameterList(String name)

      Returns a `List` containing all the values for the parameter with the given name.
      Parameters:
        `name` - the name of the parameter
      Returns:
        a `List` (never `null`, but may be empty) containing all the values for the given parameter

    - #### getFormUploads

          Map<String,List<FormUpload>> getFormUploads()

      Returns all `FormUpload`s for the request as immutable map. Returns a `Map` using the parameters name as a key and a `List` of `FormUpload`s as the value.
      Returns:
        a `Map` containing the `FileUpload`s

    - #### getFormUploads

          List<FormUpload> getFormUploads(String name)

      Returns an immutable `List` of all `FormUpload`s for the parameter with the given name.
      Parameters:
        `name` - the name of the parameters
      Returns:
        a list if `FormUpload`s (never `null`, but may be empty)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.