Package org.refcodes.net
Interface FormFields
-
- All Superinterfaces:
HttpFields<FormFields>
,java.util.Map<java.lang.String,java.util.List<java.lang.String>>
- All Known Implementing Classes:
FormFieldsImpl
public interface FormFields extends HttpFields<FormFields>
TheFormFields
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 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 void
fromBodyFormFields(java.lang.String aHttpFormFields)
Processes the HTTP Form-Fields bodyString
and retrieves the therein defined Form-Fields and adds them to theFormFields
instance.default void
fromUrl(java.lang.String aUrl)
Extracts the HTTP Query-String from the provided URL by identifying the first question mark ("?")default void
fromUrlQueryString(java.lang.String aQueryString)
Processes the HTTP Query-String and retrieves the therein defined Form-Fields and adds them to theFormFields
instance.default java.lang.String
toBodyFormFields()
Produces an HTTP Form-Fields bodyString
form the herein contain HTTP query fields.default int
toContentLength()
Calculates the length (number of characters) of theFormFields
when used for a HTTP-Body as oftoBodyFormFields()
.static FormFields
toFormFields()
Creates a newFormFields
instance.static FormFields
toFormFields(java.lang.String aFormFields)
Creates a newFormFields
instance.default java.lang.String
toUrlQueryString()
Produces an HTTP Query-String form the herein contain HTTP query fields.-
Methods inherited from interface org.refcodes.net.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, entry, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, of, of, of, of, of, of, of, of, of, of, of, ofEntries, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
toFormFields
static FormFields toFormFields()
Creates a newFormFields
instance.- Returns:
- The newly created
FormFields
instance.
-
toFormFields
static FormFields toFormFields(java.lang.String aFormFields)
Creates a newFormFields
instance.- Parameters:
aFormFields
- The Form-Fields'String
representation from which to construct theFormFields
instance.- Returns:
- The newly created
FormFields
instance.
-
fromUrlQueryString
default void fromUrlQueryString(java.lang.String aQueryString)
Processes the HTTP Query-String and retrieves the therein defined Form-Fields and adds them to theFormFields
instance.- Parameters:
aQueryString
- The HTTP Query-String from which to extract the form being added to theFormFields
instance.
-
fromBodyFormFields
default void fromBodyFormFields(java.lang.String aHttpFormFields)
Processes the HTTP Form-Fields bodyString
and retrieves the therein defined Form-Fields and adds them to theFormFields
instance.- Parameters:
aHttpFormFields
- The HTTP Form-FieldsString
from which to extract the form being added to theFormFields
instance.
-
toUrlQueryString
default java.lang.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 java.lang.String toBodyFormFields()
Produces an HTTP Form-Fields bodyString
form the herein contain HTTP query fields.- Returns:
- The HTTP Form-Fields
String
representation of thisFormFields
instance or null if this instance is empty.
-
toContentLength
default int toContentLength()
Calculates the length (number of characters) of theFormFields
when 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(java.lang.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 theFormFields
instance.- Parameters:
aUrl
- The URL from which to extract the HTTP Query-String which's Form-Fields are to be added to theFormFields
instance.
-
-