-
- All Superinterfaces:
HttpFields<FormFields>,Map<String,List<String>>
- All Known Implementing Classes:
FormFieldsImpl
public interface FormFields extends HttpFields<FormFields>
TheFormFieldsrepresent 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 nameFormFields, 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 Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description default voidfromBodyFormFields(String aHttpFormFields)Processes the HTTP Form-Fields bodyStringand retrieves the therein defined Form-Fields and adds them to theFormFieldsinstance.default voidfromUrl(String aUrl)Extracts the HTTP Query-String from the provided URL by identifying the first question mark ("?")default voidfromUrlQueryString(String aQueryString)Processes the HTTP Query-String and retrieves the therein defined Form-Fields and adds them to theFormFieldsinstance.default StringtoBodyFormFields()Produces an HTTP Form-Fields bodyStringform the herein contain HTTP query fields.default inttoContentLength()Calculates the length (number of characters) of theFormFieldswhen used for a HTTP-Body as oftoBodyFormFields().static FormFieldstoFormFields()Creates a newFormFieldsinstance.static FormFieldstoFormFields(String aFormFields)Creates a newFormFieldsinstance.default StringtoUrlQueryString()Produces an HTTP Query-String form the herein contain HTTP query fields.-
Methods inherited from interface org.refcodes.web.HttpFields
addTo, addTo, addTo, addTo, addTo, addTo, getFirst, getFirst, put, put, put, put, toField, toField, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withAddTo, withPut, withPut, withPut, withPut, withPut, withPut
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
toFormFields
static FormFields toFormFields()
Creates a newFormFieldsinstance.- Returns:
- The newly created
FormFieldsinstance.
-
toFormFields
static FormFields toFormFields(String aFormFields)
Creates a newFormFieldsinstance.- Parameters:
aFormFields- The Form-Fields'Stringrepresentation from which to construct theFormFieldsinstance.- Returns:
- The newly created
FormFieldsinstance.
-
fromUrlQueryString
default void fromUrlQueryString(String aQueryString)
Processes the HTTP Query-String and retrieves the therein defined Form-Fields and adds them to theFormFieldsinstance.- Parameters:
aQueryString- The HTTP Query-String from which to extract the form being added to theFormFieldsinstance.
-
fromBodyFormFields
default void fromBodyFormFields(String aHttpFormFields)
Processes the HTTP Form-Fields bodyStringand retrieves the therein defined Form-Fields and adds them to theFormFieldsinstance.- Parameters:
aHttpFormFields- The HTTP Form-FieldsStringfrom which to extract the form being added to theFormFieldsinstance.
-
toUrlQueryString
default String toUrlQueryString()
Produces an HTTP Query-String form the herein contain HTTP query fields.- Returns:
- The HTTP Query-String representation of this
FormFieldsinstance or null if this instance is empty.
-
toBodyFormFields
default String toBodyFormFields()
Produces an HTTP Form-Fields bodyStringform the herein contain HTTP query fields.- Returns:
- The HTTP Form-Fields
Stringrepresentation of thisFormFieldsinstance or null if this instance is empty.
-
toContentLength
default int toContentLength()
Calculates the length (number of characters) of theFormFieldswhen used for a HTTP-Body as oftoBodyFormFields().- 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 theFormFieldsinstance.- Parameters:
aUrl- The URL from which to extract the HTTP Query-String which's Form-Fields are to be added to theFormFieldsinstance.
-
-