Package org.refcodes.net
Class AbstractHttpFields<T extends HttpFields<T>>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,List<String>>
-
- org.refcodes.net.AbstractHttpFields<T>
-
- Type Parameters:
T
- The type of the sub-class, required for the builder methods such asHttpFields.withAddTo(String, String)
.
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,List<String>>
,HttpFields<T>
- Direct Known Subclasses:
AbstractHeaderFields
,FormFieldsImpl
public abstract class AbstractHttpFields<T extends HttpFields<T>> extends HashMap<String,List<String>> implements HttpFields<T>
Abstract implementation of theHeaderFields
type.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description AbstractHttpFields()
Instantiates an empty instance.AbstractHttpFields(Map<String,List<String>> aHttpFields)
Initializes the instance with the fields provided by the givenMap
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static void
copyHttpFields(Map<String,List<String>> aFromFields, HttpFields<?> aToFields)
Copies the provided "from" fields into the provided "to" fields.-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
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
-
copyHttpFields
protected static void copyHttpFields(Map<String,List<String>> aFromFields, HttpFields<?> aToFields)
Copies the provided "from" fields into the provided "to" fields. Omits empty or null values.- Parameters:
aFromFields
- The fields from which to copy.aToFields
- The fields to which to copy.
-
-