Interface HttpBodyMap

  • All Superinterfaces:
    org.refcodes.structure.CanonicalMap, org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap, org.refcodes.structure.Clearable, org.refcodes.structure.Containable, org.refcodes.mixin.DelimiterAccessor, org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Dictionary.MutableDictionary<java.lang.String,java.lang.String>, org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,java.lang.String,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>>, org.refcodes.mixin.Dumpable, org.refcodes.structure.Keys<java.lang.String,java.lang.String>, org.refcodes.structure.Keys.MutableKeys<java.lang.String,java.lang.String>, org.refcodes.structure.Keys.MutableValues<java.lang.String,java.lang.String>, java.util.Map<java.lang.String,java.lang.String>, org.refcodes.structure.PathMap<java.lang.String>, org.refcodes.structure.PathMap.MutablePathMap<java.lang.String>, org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin, org.refcodes.mixin.TypeAccessor<java.lang.String>
    All Known Implementing Classes:
    HttpBodyMapImpl

    public interface HttpBodyMap
    extends org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
    The 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap

        org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor

        org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary

        org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary.MutableDictionary

        org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K extends java.lang.Object,V extends java.lang.Object,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,V extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap

        org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
      • Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.TypeAccessor

        org.refcodes.mixin.TypeAccessor.TypeMutator<T extends java.lang.Object>, org.refcodes.mixin.TypeAccessor.TypeProperty<T extends java.lang.Object>
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      HttpBodyMap childrenOf​(java.lang.String aParentPath)
      default java.lang.String delete​(java.lang.String aKey)
      default HttpBodyMap getIndexed​(int aIndex)
      default HttpBodyMap getIndexed​(java.lang.String aPath, int aIndex)
      default java.lang.String getStatusAlias()
      Retrieves the default path's ("status/alias") status alias.
      default HttpStatusCode getStatusCode()
      Retrieves the default path's ("status/code") status code.
      default java.lang.Class<?> getStatusException()
      Retrieves the default path's ("status/exception") status exception.
      default java.lang.String getStatusMessage()
      Retrieves the default path's ("status/message") status message.
      default java.lang.Long getStatusTimeStamp()
      Retrieves the default path's ("status/Time-Stamp") status Time-Stamp.
      default boolean hasStatusAlias()
      Determines whether a default path's ("status/alias") status alias exists.
      default boolean hasStatusCode()
      Determines whether a default path's ("status/code") status code exists.
      default boolean hasStatusException()
      Determines whether a default path's ("status/exception") status exception exists.
      default boolean hasStatusMessage()
      Determines whether a default path's ("status/message") status message exists.
      default boolean hasStatusTimeStamp()
      Determines whether a default path's ("status/Time-Stamp") status Time-Stamp in milliseconds exists.
      default java.lang.String putStatusAlias​(java.lang.String aStatusAlias)
      Puts a default path's ("status/alias") status alias.
      default java.lang.String putStatusAlias​(HttpStatusCode aStatusCode)
      Puts a default path's ("status/alias") status alias.
      default java.lang.String putStatusCode​(int aStatusCode)
      Puts a default path's ("status/code") status code.
      default java.lang.String putStatusCode​(HttpStatusCode aStatusCode)
      Puts a default path's ("status/code") status code.
      default java.lang.String putStatusException​(java.lang.Class<java.lang.Exception> aStatusException)
      Puts a default path's ("status/exception") status exception.
      default java.lang.String putStatusException​(java.lang.Exception aStatusException)
      Puts a default path's ("status/exception") status exception.
      default java.lang.String putStatusMessage​(java.lang.String aStatusMessage)
      Puts a default path's ("status/message") status message.
      default java.lang.String putStatusTimeStamp()
      Puts a default path's ("status/Time-Stamp") status Time-Stamp to the current time in milliseconds as of System.currentTimeMillis()
      default java.lang.String putStatusTimeStamp​(long aStatusTimeStamp)
      Puts a default path's ("status/Time-Stamp") status Time-Stamp in milliseconds.
      default HttpBodyMap query​(java.lang.String aPathQuery)
      default HttpBodyMap query​(java.lang.String aPathQuery, java.lang.String aFromPath, java.lang.String aToPath)
      default HttpBodyMap queryFrom​(java.lang.String aPathQuery, java.lang.String aFromPath)
      default HttpBodyMap queryTo​(java.lang.String aPathQuery, java.lang.String aToPath)
      HttpBodyMap retrieve​(java.lang.String aFromPath, java.lang.String aToPath)
      HttpBodyMap retrieveFrom​(java.lang.String aFromPath)
      HttpBodyMap retrieveTo​(java.lang.String aToPath)
      default HttpBodyMap withInsert​(java.lang.Object aObj)
      default HttpBodyMap withInsert​(java.lang.String aToPath, java.lang.Object aFrom, java.lang.String aFromPath)
      default HttpBodyMap withInsertFrom​(java.lang.Object aFrom, java.lang.String aFromPath)
      default HttpBodyMap withInsertTo​(java.lang.String aToPath, java.lang.Object aFrom)
      default HttpBodyMap withPut​(java.lang.String aKey, java.lang.String aValue)
      default HttpBodyMap withPut​(org.refcodes.structure.Relation<java.lang.String,java.lang.String> aRelation)
      default HttpBodyMap withPutStatusAlias​(java.lang.String aStatusAlias)
      Puts a default path's ("status/alias") status alias.
      default HttpBodyMap withPutStatusAlias​(HttpStatusCode aStatusCode)
      Puts a default path's ("status/alias") status alias.
      default HttpBodyMap withPutStatusCode​(int aStatusCode)
      Puts a default path's ("status/code") status code.
      default HttpBodyMap withPutStatusCode​(HttpStatusCode aStatusCode)
      Puts a default path's ("status/code") status code.
      • Methods inherited from interface org.refcodes.structure.CanonicalMap

        toInstance, toInstance, toType, toType
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder

        withInsert, withInsert, withInsertFrom, withInsertTo, withPutBoolean, withPutByte, withPutDouble, withPutFloat, withPutInteger, withPutLong, withPutShort, withRemoveFrom
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap

        containsValue, insert, insert, insertFrom, insertTo, put, putAll, putAll, putAll, toDump, toSourceCode, toSourceCode
      • Methods inherited from interface org.refcodes.structure.Containable

        isEmpty, size
      • Methods inherited from interface org.refcodes.mixin.DelimiterAccessor

        getDelimiter
      • Methods inherited from interface org.refcodes.mixin.Dumpable

        toDump
      • Methods inherited from interface java.util.Map

        clear, compute, computeIfAbsent, computeIfPresent, containsKey, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from interface org.refcodes.structure.PathMap

        directories, directories, entries, entries, fromExternalKey, get, get, getArray, getArray, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getIndexes, getIndexes, getInteger, getInteger, getLong, getLong, getRootPath, getShort, getShort, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isDirectory, isEntry, isIndexed, isIndexed, isPath, isRecord, isRootPath, keySet, paths, paths, queryPaths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath, toPath
      • Methods inherited from interface org.refcodes.structure.PathMap.MutablePathMap

        insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, putArray, putArray, remove, remove, removeAll, removeAll, removeFrom, removeFrom, removeFrom, removeFrom
      • Methods inherited from interface org.refcodes.structure.PathMap.PathMapBuilder

        withInsert, withInsert, withInsertFrom, withInsertTo
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin

        containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin

        withPut
      • Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin

        put, put, putBoolean, putBoolean, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort
      • Methods inherited from interface org.refcodes.mixin.TypeAccessor

        getType
    • Method Detail

      • hasStatusCode

        default boolean hasStatusCode()
        Determines whether a default path's ("status/code") status code exists.
        Returns:
        True in case there is a valid value for the status code default path.
      • putStatusCode

        default java.lang.String putStatusCode​(int aStatusCode)
        Puts a default path's ("status/code") status code.
        Parameters:
        aStatusCode - The status code value to be set.
        Returns:
        The previously set value for the status code default path.
      • withPutStatusCode

        default HttpBodyMap withPutStatusCode​(int aStatusCode)
        Puts a default path's ("status/code") status code.
        Parameters:
        aStatusCode - The status code value to be set.
        Returns:
        The previously set value for the status code default path.
      • putStatusCode

        default java.lang.String putStatusCode​(HttpStatusCode aStatusCode)
        Puts a default path's ("status/code") status code.
        Parameters:
        aStatusCode - The HttpStatusCode to be set.
        Returns:
        The previously set value for the status code default path.
      • withPutStatusCode

        default HttpBodyMap withPutStatusCode​(HttpStatusCode aStatusCode)
        Puts a default path's ("status/code") status code.
        Parameters:
        aStatusCode - The HttpStatusCode to be set.
        Returns:
        The previously set value for the status code default path.
      • getStatusCode

        default HttpStatusCode getStatusCode()
        Retrieves the default path's ("status/code") status code.
        Returns:
        The previously set value for the status code default path.
      • hasStatusAlias

        default boolean hasStatusAlias()
        Determines whether a default path's ("status/alias") status alias exists.
        Returns:
        True in case there is a valid value for the status alias default path.
      • putStatusAlias

        default java.lang.String putStatusAlias​(java.lang.String aStatusAlias)
        Puts a default path's ("status/alias") status alias.
        Parameters:
        aStatusAlias - The status alias value to be set.
        Returns:
        The previously set value for the status alias default path.
      • withPutStatusAlias

        default HttpBodyMap withPutStatusAlias​(java.lang.String aStatusAlias)
        Puts a default path's ("status/alias") status alias.
        Parameters:
        aStatusAlias - The status alias value to be set.
        Returns:
        The previously set value for the status alias default path.
      • putStatusAlias

        default java.lang.String putStatusAlias​(HttpStatusCode aStatusCode)
        Puts a default path's ("status/alias") status alias.
        Parameters:
        aStatusCode - The HttpStatusCode, which's verbose alias is to be set.
        Returns:
        The previously set value for the status alias default path.
      • withPutStatusAlias

        default HttpBodyMap withPutStatusAlias​(HttpStatusCode aStatusCode)
        Puts a default path's ("status/alias") status alias.
        Parameters:
        aStatusCode - The HttpStatusCode, which's verbose alias is to be set.
        Returns:
        The previously set value for the status alias default path.
      • getStatusAlias

        default java.lang.String getStatusAlias()
        Retrieves the default path's ("status/alias") status alias.
        Returns:
        The previously set value for the status alias default path.
      • hasStatusMessage

        default boolean hasStatusMessage()
        Determines whether a default path's ("status/message") status message exists.
        Returns:
        True in case there is a valid value for the status message default path.
      • putStatusMessage

        default java.lang.String putStatusMessage​(java.lang.String aStatusMessage)
        Puts a default path's ("status/message") status message.
        Parameters:
        aStatusMessage - The status message value to be set.
        Returns:
        The previously set value for the status message default path.
      • getStatusMessage

        default java.lang.String getStatusMessage()
        Retrieves the default path's ("status/message") status message.
        Returns:
        The previously set value for the status message default path.
      • hasStatusTimeStamp

        default boolean hasStatusTimeStamp()
        Determines whether a default path's ("status/Time-Stamp") status Time-Stamp in milliseconds exists.
        Returns:
        True in case there is a valid value for the status Time-Stamp default path.
      • putStatusTimeStamp

        default java.lang.String putStatusTimeStamp​(long aStatusTimeStamp)
        Puts a default path's ("status/Time-Stamp") status Time-Stamp in milliseconds.
        Parameters:
        aStatusTimeStamp - The status Time-Stamp value to be set.
        Returns:
        The previously set value for the status Time-Stamp default path.
      • putStatusTimeStamp

        default java.lang.String putStatusTimeStamp()
        Puts a default path's ("status/Time-Stamp") status Time-Stamp to the current time in milliseconds as of System.currentTimeMillis()
        Returns:
        The previously set value for the status Time-Stamp default path.
      • getStatusTimeStamp

        default java.lang.Long getStatusTimeStamp()
        Retrieves the default path's ("status/Time-Stamp") status Time-Stamp.
        Returns:
        The previously set value for the status Time-Stamp default path.
      • hasStatusException

        default boolean hasStatusException()
        Determines whether a default path's ("status/exception") status exception exists.
        Returns:
        True in case there is a valid value for the status exception default path.
      • putStatusException

        default java.lang.String putStatusException​(java.lang.Class<java.lang.Exception> aStatusException)
        Puts a default path's ("status/exception") status exception.
        Parameters:
        aStatusException - The status exception value to be set.
        Returns:
        The previously set value for the status exception default path.
      • putStatusException

        default java.lang.String putStatusException​(java.lang.Exception aStatusException)
        Puts a default path's ("status/exception") status exception.
        Parameters:
        aStatusException - The status exception value to be set.
        Returns:
        The previously set value for the status exception default path.
      • getStatusException

        default java.lang.Class<?> getStatusException()
        Retrieves the default path's ("status/exception") status exception.
        Returns:
        The previously set value for the status exception default path.
      • withPut

        default HttpBodyMap withPut​(java.lang.String aKey,
                                    java.lang.String aValue)
        Specified by:
        withPut in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withPut in interface org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,java.lang.String,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>>
        Specified by:
        withPut in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
        Specified by:
        withPut in interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder>
      • withPut

        default HttpBodyMap withPut​(org.refcodes.structure.Relation<java.lang.String,java.lang.String> aRelation)
        Specified by:
        withPut in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withPut in interface org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,java.lang.String,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>>
        Specified by:
        withPut in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
      • withInsert

        default HttpBodyMap withInsert​(java.lang.Object aObj)
        Specified by:
        withInsert in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withInsert in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
      • withInsertFrom

        default HttpBodyMap withInsertFrom​(java.lang.Object aFrom,
                                           java.lang.String aFromPath)
        Specified by:
        withInsertFrom in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withInsertFrom in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
      • withInsertTo

        default HttpBodyMap withInsertTo​(java.lang.String aToPath,
                                         java.lang.Object aFrom)
        Specified by:
        withInsertTo in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withInsertTo in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
      • withInsert

        default HttpBodyMap withInsert​(java.lang.String aToPath,
                                       java.lang.Object aFrom,
                                       java.lang.String aFromPath)
        Specified by:
        withInsert in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withInsert in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
      • retrieveFrom

        HttpBodyMap retrieveFrom​(java.lang.String aFromPath)
        Specified by:
        retrieveFrom in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveFrom in interface org.refcodes.structure.PathMap<java.lang.String>
      • retrieveTo

        HttpBodyMap retrieveTo​(java.lang.String aToPath)
        Specified by:
        retrieveTo in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieveTo in interface org.refcodes.structure.PathMap<java.lang.String>
      • retrieve

        HttpBodyMap retrieve​(java.lang.String aFromPath,
                             java.lang.String aToPath)
        Specified by:
        retrieve in interface org.refcodes.structure.CanonicalMap
        Specified by:
        retrieve in interface org.refcodes.structure.PathMap<java.lang.String>
      • childrenOf

        HttpBodyMap childrenOf​(java.lang.String aParentPath)
        Specified by:
        childrenOf in interface org.refcodes.structure.CanonicalMap
        Specified by:
        childrenOf in interface org.refcodes.structure.PathMap<java.lang.String>
      • delete

        default java.lang.String delete​(java.lang.String aKey)
        Specified by:
        delete in interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
        Specified by:
        delete in interface org.refcodes.structure.Keys.MutableKeys<java.lang.String,java.lang.String>
        Specified by:
        delete in interface org.refcodes.structure.PathMap.MutablePathMap<java.lang.String>
      • getIndexed

        default HttpBodyMap getIndexed​(int aIndex)
        Specified by:
        getIndexed in interface org.refcodes.structure.CanonicalMap
        Specified by:
        getIndexed in interface org.refcodes.structure.PathMap<java.lang.String>
      • getIndexed

        default HttpBodyMap getIndexed​(java.lang.String aPath,
                                       int aIndex)
        Specified by:
        getIndexed in interface org.refcodes.structure.CanonicalMap
        Specified by:
        getIndexed in interface org.refcodes.structure.PathMap<java.lang.String>
      • query

        default HttpBodyMap query​(java.lang.String aPathQuery)
        Specified by:
        query in interface org.refcodes.structure.CanonicalMap
        Specified by:
        query in interface org.refcodes.structure.PathMap<java.lang.String>
      • queryTo

        default HttpBodyMap queryTo​(java.lang.String aPathQuery,
                                    java.lang.String aToPath)
        Specified by:
        queryTo in interface org.refcodes.structure.CanonicalMap
        Specified by:
        queryTo in interface org.refcodes.structure.PathMap<java.lang.String>
      • queryFrom

        default HttpBodyMap queryFrom​(java.lang.String aPathQuery,
                                      java.lang.String aFromPath)
        Specified by:
        queryFrom in interface org.refcodes.structure.CanonicalMap
        Specified by:
        queryFrom in interface org.refcodes.structure.PathMap<java.lang.String>
      • query

        default HttpBodyMap query​(java.lang.String aPathQuery,
                                  java.lang.String aFromPath,
                                  java.lang.String aToPath)
        Specified by:
        query in interface org.refcodes.structure.CanonicalMap
        Specified by:
        query in interface org.refcodes.structure.PathMap<java.lang.String>