public interface HttpFields<B extends HttpFields<B>> extends Map<String,List<String>>
HeaderFields
as well as the FormFields
.
This interface represents this kind of data structure providing some common
convenience methods.Modifier and Type | Method and Description |
---|---|
default void |
addTo(String aField,
List<String> aValues)
Adds values to the list of values associated with the given header field
(key),
|
default void |
addTo(String aField,
String... aValues)
Adds values to the list of values associated with the given header field
(key),
|
default void |
addTo(String aField,
String aValue)
Adds a value to the list of values associated with the given header field
(key),
|
default String |
getFirst(String aField)
Returns the first header field value in the list of values associated
with the given header field.
|
default List<String> |
put(String aField,
String... aValues)
Performs a #set(String, String) on multiple values.
|
default List<String> |
put(String aField,
String aValue)
Sets a single value for the header field (key).
|
default String |
toField(String aKey)
This method returns a single
String (instead of returning a
List of String instances when calling
Map.get(Object) ) where the elements of the filed are separated by
the Delimiter.HTTP_HEADER_ELEMENTS and concatenated as
a single String . |
default B |
withAddTo(String aField,
List<String> aValues)
Builder method for the
addTo(String, List) method. |
default B |
withAddTo(String aField,
String... aValues)
Builder method for the
addTo(String, String...) method. |
default B |
withAddTo(String aField,
String aValue)
Builder method for the
addTo(String, String) method. |
default B |
withPut(String aField,
List<String> aValues)
Builder method for the
Map.put(Object, Object) method. |
default B |
withPut(String aField,
String... aValues)
Builder method for the
put(String, String...) method. |
default B |
withPut(String aField,
String aValue)
Builder method for the
put(String, String) method. |
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
default String getFirst(String aField)
aField
- The header field (key) of which's values the first value is
to be retrieved.default List<String> put(String aField, String aValue)
aField
- The header field for which to set a single value.aValue
- The single value to be set for the header field (key).default List<String> put(String aField, String... aValues)
aField
- The header field for which to set the values.aValues
- The values to be set for the header field (key).default B withPut(String aField, String aValue)
put(String, String)
method.aField
- The header field for which to set a single value.aValue
- The single value to be set for the header field (key).HttpFields
instance to continue building up the
header fields.default B withPut(String aField, List<String> aValues)
Map.put(Object, Object)
method.aField
- The header field for which to set the values.aValues
- The values to be set for the header field (key).HttpFields
instance to continue building up the
header fields.default B withPut(String aField, String... aValues)
put(String, String...)
method.aField
- The header field for which to set the values.aValues
- The values to be set for the header field (key).HttpFields
instance to continue building up the
header fields.default void addTo(String aField, String aValue)
aField
- The header field (key) of which's list of values a value is
to be added.aValue
- The value to be added to the list of values associated to
the given header field (key).default void addTo(String aField, String... aValues)
aField
- The header field (key) of which's list of values the values
are to be added.aValues
- The values to be added to the list of values associated to
the given header field (key).default void addTo(String aField, List<String> aValues)
aField
- The header field (key) of which's list of values the values
are to be added.aValues
- The values to be added to the list of values associated to
the given header field (key).default B withAddTo(String aField, String aValue)
addTo(String, String)
method.aField
- The header field (key) of which's list of values a value is
to be added.aValue
- The value to be added to the list of values associated to
the given header field (key).HttpFields
instance to continue building up the
header fields.default B withAddTo(String aField, String... aValues)
addTo(String, String...)
method.aField
- The header field (key) of which's list of values the values
are to be added.aValues
- The values to be added to the list of values associated to
the given header field (key).HttpFields
instance to continue building up the
header fields.default B withAddTo(String aField, List<String> aValues)
addTo(String, List)
method.aField
- The header field (key) of which's list of values the values
are to be added.aValues
- The values to be added to the list of values associated to
the given header field (key).HttpFields
instance to continue building up the
header fields.Copyright © 2017. All rights reserved.