Interface HttpFields<B extends HttpFields<B>>
- Type Parameters:
B- The generic type of the builder to be returned upon invoking builder methods.
- All Known Subinterfaces:
HeaderFields<C,B>
- All Known Implementing Classes:
AbstractHeaderFields,AbstractHttpFields,FormFields,RequestHeaderFields,ResponseHeaderFields
Various key/value "collections" we run across when we develop HTTP based
applications may have more then one value for one key. Such "collections" in
this package are the
HeaderFields as well as the FormFields.
This interface represents this kind of data structure providing some common
convenience methods.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddAll(HttpFields<?> aHttpFields) Adds all fields found in the providedHttpFieldsinstance.default voidSame asaddTo(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.default voidSame asaddTo(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.default voidSame asaddTo(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.default voidAdds a value to the list of values associated with the given Header-Field (key).default voidAdds values to the list of values associated with the given Header-Field (key).default voidAdds values to the list of values associated with the given Header-Field (key),.default StringSame asgetFirst(String)though using the provided enumeration'sEnum.toString()method to determine the key.default StringReturns the first Header-Field value in the list of values associated with the given Header-Field.Same asput(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.Same asput(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.Sets a single value for the Header-Field (key).Performs a #set(String, String) on multiple values.default StringSame astoField(String)though using the provided enumeration'sEnum.toString()method to determine the key.default StringThis method returns a singleString(instead of returning aListofStringinstances when callingMap.get(Object)) where the elements of the filed are separated by theDelimiter.HTTP_HEADER_ELEMENTSand concatenated as a singleString.default BSame aswithAddTo(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.default BSame aswithAddTo(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.default BSame aswithAddTo(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.default BBuilder method for theaddTo(String, String)method.default BBuilder method for theaddTo(String, String...)method.default BBuilder method for theaddTo(String, List)method.default BSame aswithPut(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.default BSame aswithPut(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.default BSame aswithPut(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.default BBuilder method for theput(String, String)method.default BBuilder method for theput(String, String...)method.default BBuilder method for theMap.put(Object, Object)method.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 Details
-
addAll
Adds all fields found in the providedHttpFieldsinstance.- Parameters:
aHttpFields- TheHttpFieldsinstances which's fields are to be added.
-
getFirst
Returns the first Header-Field value in the list of values associated with the given Header-Field.- Parameters:
aField- The Header-Field (key) of which's values the first value is to be retrieved.- Returns:
- The first value in the list of values associated to the given Header-Field (key).
-
getFirst
Same asgetFirst(String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the field- Returns:
- the first
- See Also:
-
put
Sets a single value for the Header-Field (key). Any values previously associated to the given Header-Field (key) are lost.- Parameters:
aField- The Header-Field for which to set a single value.aValue- The single value to be set for the Header-Field (key).- Returns:
- the list
-
put
Same asput(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValue- the value- Returns:
- the list
- See Also:
-
put
-
put
Same asput(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- Returns:
- the list
- See Also:
-
withPut
Builder method for theput(String, String)method.- Parameters:
aField- The Header-Field for which to set a single value.aValue- The single value to be set for the Header-Field (key).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withPut
Same aswithPut(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValue- the value- Returns:
- the b
- See Also:
-
withPut
Builder method for theMap.put(Object, Object)method.- Parameters:
aField- The Header-Field for which to set the values.aValues- The values to be set for the Header-Field (key).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withPut
Same aswithPut(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- Returns:
- the b
- See Also:
-
withPut
Builder method for theput(String, String...)method.- Parameters:
aField- The Header-Field for which to set the values.aValues- The values to be set for the Header-Field (key).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withPut
Same aswithPut(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- Returns:
- the b
- See Also:
-
addTo
Adds a value to the list of values associated with the given Header-Field (key).- Parameters:
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).
-
addTo
Same asaddTo(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValue- the value- See Also:
-
addTo
Adds values to the list of values associated with the given Header-Field (key).- Parameters:
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).
-
addTo
Same asaddTo(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- See Also:
-
addTo
Adds values to the list of values associated with the given Header-Field (key),.- Parameters:
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).
-
addTo
Same asaddTo(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- See Also:
-
withAddTo
Builder method for theaddTo(String, String)method.- Parameters:
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).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withAddTo
Same aswithAddTo(String, String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValue- the value- Returns:
- the b
- See Also:
-
withAddTo
Builder method for theaddTo(String, String...)method.- Parameters:
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).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withAddTo
Same aswithAddTo(String, String...)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- Returns:
- the b
- See Also:
-
withAddTo
Builder method for theaddTo(String, List)method.- Parameters:
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).- Returns:
- This
HttpFieldsinstance to continue building up the Header-Fields.
-
withAddTo
Same aswithAddTo(String, List)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the fieldaValues- the values- Returns:
- the b
- See Also:
-
toField
This method returns a singleString(instead of returning aListofStringinstances when callingMap.get(Object)) where the elements of the filed are separated by theDelimiter.HTTP_HEADER_ELEMENTSand concatenated as a singleString. -
toField
Same astoField(String)though using the provided enumeration'sEnum.toString()method to determine the key.- Parameters:
aField- the field- Returns:
- the string
- See Also:
-