Interface FormFields

All Superinterfaces:
HttpFields<FormFields>, Map<String,​List<String>>
All Known Implementing Classes:
FormFieldsImpl

public interface FormFields
extends HttpFields<FormFields>
The FormFields represent the URL's Query-String by the notation originally used by the GET request of the ancient web forms (see "https://en.wikipedia.org/wiki/Query_string#Web_forms"). Therefore the name FormFields, as them web forms provided fields with values (see "https://en.wikipedia.org/wiki/Form_(HTML)")
See Also:
"https://en.wikipedia.org/wiki/Query_string"
  • Method Details

    • toFormFields

      static FormFields toFormFields()
      Creates a new FormFields instance.
      Returns:
      The newly created FormFields instance.
    • toFormFields

      static FormFields toFormFields​(String aFormFields)
      Creates a new FormFields instance.
      Parameters:
      aFormFields - The Form-Fields' String representation from which to construct the FormFields instance.
      Returns:
      The newly created FormFields instance.
    • fromUrlQueryString

      default void fromUrlQueryString​(String aQueryString)
      Processes the HTTP Query-String and retrieves the therein defined Form-Fields and adds them to the FormFields instance.
      Parameters:
      aQueryString - The HTTP Query-String from which to extract the form being added to the FormFields instance.
    • fromBodyFormFields

      default void fromBodyFormFields​(String aHttpFormFields)
      Processes the HTTP Form-Fields body String and retrieves the therein defined Form-Fields and adds them to the FormFields instance.
      Parameters:
      aHttpFormFields - The HTTP Form-Fields String from which to extract the form being added to the FormFields instance.
    • toUrlQueryString

      default String toUrlQueryString()
      Produces an HTTP Query-String form the herein contain HTTP query fields.
      Returns:
      The HTTP Query-String representation of this FormFields instance or null if this instance is empty.
    • toBodyFormFields

      default String toBodyFormFields()
      Produces an HTTP Form-Fields body String form the herein contain HTTP query fields.
      Returns:
      The HTTP Form-Fields String representation of this FormFields instance or null if this instance is empty.
    • toContentLength

      default int toContentLength()
      Calculates the length (number of characters) of the FormFields when used for a HTTP-Body as of toBodyFormFields().
      Returns:
      The length of the HTTP-Body representation of the content of these FormFields.
    • fromUrl

      default void fromUrl​(String aUrl)
      Extracts the HTTP Query-String from the provided URL by identifying the first question mark ("?") and retrieves the therein defined Form-Fields and adds them to the FormFields instance.
      Parameters:
      aUrl - The URL from which to extract the HTTP Query-String which's Form-Fields are to be added to the FormFields instance.