public interface HttpBodyMap
extends org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
HttpBodyMap
type is a "dynamic" type in terms of it's structure
being represented by paths'. When a data structure is parsed e.g. from JSON
or XML, then the data structure's internal structure and values are reflected
by according paths's and values in the HttpBodyMap
.
The HttpBodyMap
is actually a specialization of the PathMap
using String
objects as values and a slash ("/") as path delimiter.
Using the HttpBodyMap
it is convenient to navigate or address
elements from unknown or dynamic data structures. The other way round the
HttpBodyMap
may be used to construct dynamic data types by adding the
according paths's and values for marshaling into e.g. JSON or XML.
Think of an HttpBodyMap
as a flattened JSON or XML structure.
The HttpClientResponseImpl
, HttpServerRequestImpl
,
HttpServerResponseImpl
as well as the HttpClientResponseImpl
implementations directly support the HttpBodyMap
, given that the
MediaTypeFactory
being used supports marshaling and unmarshaling from
and to nested Map
instances. The HttpBodyMap
acts as a view
of the nested Map
structures, which are somehow inconvenient to
navigate through.
The HttpClientRequest.setRequest(Object)
implementation supports the
HttpBodyMap
to marshal an HttpBodyMap
into an HTTP
Request-Body.
The HttpClientResponse.getResponse(Class)
implementation supports the
HttpBodyMap
to unmarshal an HTTP Response-Body into an
HttpBodyMap
.
The HttpServerRequest.getRequest(Class)
implementation supports the
HttpBodyMap
to unmarshal an HTTP Request-Body into an
HttpBodyMap
.
The HttpServerResponse.setResponse(Object)
implementation supports
the HttpBodyMap
to marshal an HttpBodyMap
into an HTTP
Request-Body.org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
org.refcodes.structure.PathMap.MutablePathMap<T>, org.refcodes.structure.PathMap.PathMapBuilder<T>
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
org.refcodes.mixin.TypeAccessor.TypeMutator<T>, org.refcodes.mixin.TypeAccessor.TypeProperty<T>
org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
Modifier and Type | Method and Description |
---|---|
default String |
delete(String aKey)
Delete.
|
HttpBodyMap |
retrieve(String aFromPath,
String aToPath)
Retrieve.
|
HttpBodyMap |
retrieveFrom(String aFromPath)
Retrieve from.
|
HttpBodyMap |
retrieveTo(String aToPath)
Retrieve to.
|
static HttpBodyMap |
toHttpBodyMap()
Creates an empty
HttpBodyMap . |
static HttpBodyMap |
toHttpBodyMap(Object aObj)
Factory method to create a
HttpBodyMap instance containing the
elements as of PathMap.MutablePathMap.insert(Object) . |
static HttpBodyMap |
toHttpBodyMap(Object aObj,
String aFromPath)
Factory method to create a
HttpBodyMap instance containing the
elements as of PathMap.MutablePathMap.insert(Object) using the default path deimeter
"/" for the path declarations. |
static HttpBodyMap |
toHttpBodyMap(String aToPath,
Object aObj)
Factory method to create a
HttpBodyMap instance containing the
elements as of PathMap.MutablePathMap.insert(Object) using the default path deimeter
"/" for the path declarations. |
static HttpBodyMap |
toHttpBodyMap(String aToPath,
Object aObj,
String aFromPath)
Factory method to create a
HttpBodyMap instance containing the
elements as of PathMap.MutablePathMap.insert(Object) using the default path deimeter
"/" for the path declarations. |
default HttpBodyMap |
withInsert(Object aObj)
With insert.
|
default HttpBodyMap |
withInsert(String aToPath,
Object aFrom,
String aFromPath)
With insert.
|
default HttpBodyMap |
withInsertFrom(Object aFrom,
String aFromPath)
With insert from.
|
default HttpBodyMap |
withInsertTo(String aToPath,
Object aFrom)
With insert to.
|
default HttpBodyMap |
withPut(org.refcodes.structure.Relation<String,String> aRelation)
With put.
|
default HttpBodyMap |
withPut(String aKey,
String aValue)
With put.
|
toCanonicalMapBuilder, toCanonicalMapBuilder, toCanonicalMapBuilder, toCanonicalMapBuilder, withPutBoolean, withPutByte, withPutDouble, withPutFloat, withPutInteger, withPutLong, withPutShort, withRemoveFrom
toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMap, toPathMapBuilder, toPathMapBuilder, toPathMapBuilder, toPathMapBuilder
containsValue, put, putAll, putAll, putAll, toDump, toSourceCode
get, getBoolean, getBoolean, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort
insert, insert, insertFrom, insertTo, put, putArray, putArray, removeAll
directories, directories, entries, entries, getArray, getArray, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPathMap, toPathMap, toRootPath
clear, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
static HttpBodyMap toHttpBodyMap()
HttpBodyMap
.HttpBodyMap
instance.static HttpBodyMap toHttpBodyMap(Object aObj)
HttpBodyMap
instance containing the
elements as of PathMap.MutablePathMap.insert(Object)
.aObj
- The object from which the elements are to be added.HttpBodyMap
.static HttpBodyMap toHttpBodyMap(String aToPath, Object aObj)
HttpBodyMap
instance containing the
elements as of PathMap.MutablePathMap.insert(Object)
using the default path deimeter
"/" for the path declarations.aToPath
- The sub-path where to insert the object's introspected
values to.aObj
- The object from which the elements are to be added.static HttpBodyMap toHttpBodyMap(Object aObj, String aFromPath)
HttpBodyMap
instance containing the
elements as of PathMap.MutablePathMap.insert(Object)
using the default path deimeter
"/" for the path declarations.aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the
provided object.static HttpBodyMap toHttpBodyMap(String aToPath, Object aObj, String aFromPath)
HttpBodyMap
instance containing the
elements as of PathMap.MutablePathMap.insert(Object)
using the default path deimeter
"/" for the path declarations.aToPath
- The sub-path where to insert the object's introspected
values to.aObj
- The object from which the elements are to be added.aFromPath
- The path from where to start adding elements of the
provided object.default HttpBodyMap withPut(String aKey, String aValue)
withPut
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withPut
in interface org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<String,String,org.refcodes.structure.PathMap.PathMapBuilder<String>>
withPut
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aKey
- the a keyaValue
- the a valuedefault HttpBodyMap withPut(org.refcodes.structure.Relation<String,String> aRelation)
withPut
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withPut
in interface org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<String,String,org.refcodes.structure.PathMap.PathMapBuilder<String>>
withPut
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aRelation
- the a relationdefault HttpBodyMap withInsert(Object aObj)
withInsert
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withInsert
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aObj
- the a objdefault HttpBodyMap withInsertFrom(Object aFrom, String aFromPath)
withInsertFrom
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withInsertFrom
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aFrom
- the a fromaFromPath
- the a from pathdefault HttpBodyMap withInsertTo(String aToPath, Object aFrom)
withInsertTo
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withInsertTo
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aToPath
- the a to pathaFrom
- the a fromdefault HttpBodyMap withInsert(String aToPath, Object aFrom, String aFromPath)
withInsert
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withInsert
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aToPath
- the a to pathaFrom
- the a fromaFromPath
- the a from pathHttpBodyMap retrieveFrom(String aFromPath)
retrieveFrom
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
retrieveFrom
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
retrieveFrom
in interface org.refcodes.structure.PathMap<String>
retrieveFrom
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
retrieveFrom
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aFromPath
- the a from pathHttpBodyMap retrieveTo(String aToPath)
retrieveTo
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
retrieveTo
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
retrieveTo
in interface org.refcodes.structure.PathMap<String>
retrieveTo
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
retrieveTo
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aToPath
- the a to pathHttpBodyMap retrieve(String aFromPath, String aToPath)
retrieve
in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
retrieve
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
retrieve
in interface org.refcodes.structure.PathMap<String>
retrieve
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
retrieve
in interface org.refcodes.structure.PathMap.PathMapBuilder<String>
aFromPath
- the a from pathaToPath
- the a to pathdefault String delete(String aKey)
delete
in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
delete
in interface org.refcodes.structure.Keys.MutableKeys<String,String>
delete
in interface org.refcodes.structure.PathMap.MutablePathMap<String>
aKey
- the a keyCopyright © 2017. All rights reserved.