Interface ContentType

  • 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,T>, org.refcodes.structure.Dictionary.MutableDictionary<java.lang.String,T>, org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,T,org.refcodes.structure.PathMap.PathMapBuilder<T>>, org.refcodes.mixin.Dumpable, HttpMediaType, HttpMediaTypeAccessor.HttpMediaTypeProvider<java.lang.String>, org.refcodes.structure.Keys<java.lang.String,T>, org.refcodes.structure.Keys.MutableKeys<java.lang.String,T>, org.refcodes.structure.Keys.MutableValues<java.lang.String,T>, java.util.Map<java.lang.String,T>, MediaTypeAccessor, 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.configuration.Properties, org.refcodes.configuration.Properties.MutableProperties, org.refcodes.configuration.Properties.PropertiesBuilder, org.refcodes.structure.PropertiesAccessorMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<java.lang.String>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin, TopLevelTypeAccessor, org.refcodes.mixin.TypeAccessor<java.lang.String>
    All Known Implementing Classes:
    ContentTypeImpl


    public interface ContentType
    extends TopLevelTypeAccessor, MediaTypeAccessor, org.refcodes.configuration.Properties.PropertiesBuilder, HttpMediaType
    A ContentType represents a MediaType and its according TopLevelType with additional (optional) suffixed parameters (as of the according HTTP Header-Fields). In other words, it is a concrete occurrence of a MediaType in an HTTP header including the particular parameters. A ContentType with the particular parameters may look as follows: "application/json;charset=UTF-8" in case of MediaType.APPLICATION_JSON and the parameter' MediaTypeParameter.CHARSET name set to the Encoding.UTF_8 code.
    • 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 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.configuration.Properties

        org.refcodes.configuration.Properties.MutableProperties, org.refcodes.configuration.Properties.PropertiesBuilder
      • 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>
    • Field Summary

      • Fields inherited from interface org.refcodes.configuration.Properties

        DEFAULT_COMMENT
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default java.lang.String getCharsetParametrer​()
      Retrieves the charset parameter from the properties of this ContentType instance.
      default TopLevelType getTopLevelType​()
      Retrieves the Media-Top-Level-Type from the Media-Top-Level-Type property.
      default java.lang.String put​(MediaTypeParameter aParameter, java.lang.String aValue)
      Put.
      default java.lang.String putCharsetParametrer​(java.lang.String aCharsetCode)
      Sets the charset parameter's charset-code.
      default java.lang.String toHttpMediaType​()
      Returns the HTTP media type: It consists of the Media-Top-Level-Type ( getTopLevelType() and the Media-Subtype ( MediaTypeAccessor.getMediaType()) as well as some (optional) suffixed parameters (as of Keys.keySet() and Keys.get(Object), mutable via Keys.MutableValues.put(Object, Object)) all being concatenated in an HTTP valid manner, such as: "application/json;charset=UTF-8".
      default ContentType withCharsetParametrer​(java.lang.String aValue)
      Sets the charset parameter's charset-code.
      default ContentType withPut​(java.lang.String aKey, java.lang.String aValue)
      default ContentType withPut​(MediaTypeParameter aParameter, java.lang.String aValue)
      With put.
      default ContentType withPut​(org.refcodes.structure.Relation<java.lang.String,java.lang.String> aProperty)
      • 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
      • Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap

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

        clear
      • Methods inherited from interface org.refcodes.structure.Containable

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

        toDump
      • Methods inherited from interface org.refcodes.structure.Keys.MutableValues

        put
      • Methods inherited from interface org.refcodes.structure.PathMap

        children, children, children, directories, directories, directories, directories, directories, fromExternalKey, get, get, getArray, getArray, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getIndexes, getIndexes, getInteger, getInteger, getLong, getLong, getRootPath, getShort, getShort, hasChildren, hasChildren, hasChildren, hasIndexed, hasIndexed, hasParentPath, isArray, isArray, isArray, isArray, isArray, isChild, isChild, isChild, isDirectory, isDirectory, isDirectory, isDirectory, isIndexed, isIndexed, isPath, isRecord, isRecord, isRecord, isRecord, isRootPath, keySet, paths, paths, paths, paths, paths, queryPaths, records, records, records, records, records, toDataStructure, toDataStructure, toExternalKey, 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.configuration.Properties

        getDelimiter, getType, query, query, queryFrom, queryTo, retrieve, retrieveFrom, retrieveFrom, retrieveFrom, retrieveFrom, retrieveTo, retrieveTo, retrieveTo, retrieveTo, toMap, toProperties, toPropertyPath
      • Methods inherited from interface org.refcodes.configuration.Properties.MutableProperties

        containsValue, delete, delete, insert, insert, insertFrom, insertTo, put, putAll, putAll, putAll
      • Methods inherited from interface org.refcodes.configuration.Properties.PropertiesBuilder

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

        asArray, asArray, asArray, asArray, asArray, asArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asBooleanArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asByteArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asCharacterArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asDoubleArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asFloatArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asIntegerArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asLongArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, asShortArray, containsKey, get, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getCharacter, getCharacter, getCharacter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInteger, getInteger, getInteger, getLong, getLong, getLong, getShort, 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
    • Method Detail

      • getTopLevelType

        default TopLevelType getTopLevelType​()
        Retrieves the Media-Top-Level-Type from the Media-Top-Level-Type property.
        Specified by:
        getTopLevelType in interface TopLevelTypeAccessor
        Returns:
        The Media-Top-Level-Type stored by the Media-Top-Level-Type property.
      • withPut

        default ContentType 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,T extends java.lang.Object,org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>>
        Specified by:
        withPut in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
        Specified by:
        withPut in interface org.refcodes.configuration.Properties.PropertiesBuilder
        Specified by:
        withPut in interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<java.lang.String>
      • withPut

        default ContentType withPut​(org.refcodes.structure.Relation<java.lang.String,java.lang.String> aProperty)
        Specified by:
        withPut in interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
        Specified by:
        withPut in interface org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,T extends java.lang.Object,org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>>
        Specified by:
        withPut in interface org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
        Specified by:
        withPut in interface org.refcodes.configuration.Properties.PropertiesBuilder
      • put

        default java.lang.String put​(MediaTypeParameter aParameter,
                                     java.lang.String aValue)
        Put.
        Parameters:
        aParameter - the parameter
        aValue - the value
        Returns:
        the string
      • withPut

        default ContentType withPut​(MediaTypeParameter aParameter,
                                    java.lang.String aValue)
        With put.
        Parameters:
        aParameter - the aarameter
        aValue - the value
        Returns:
        the content type
      • getCharsetParametrer

        default java.lang.String getCharsetParametrer​()
        Retrieves the charset parameter from the properties of this ContentType instance.
        Returns:
        The charset parameter or null if none is found.
      • putCharsetParametrer

        default java.lang.String putCharsetParametrer​(java.lang.String aCharsetCode)
        Sets the charset parameter's charset-code.
        Parameters:
        aCharsetCode - The code of the charset to be set (e.g. "UTF-8"), see Encoding for some common codes.
        Returns:
        The charset parameter's charset-code (if previously been set) or null if none was set before.
      • withCharsetParametrer

        default ContentType withCharsetParametrer​(java.lang.String aValue)
        Sets the charset parameter's charset-code.
        Parameters:
        aValue - the value
        Returns:
        This ContentType instance as of the Builder-Pattern.
      • toHttpMediaType

        default java.lang.String toHttpMediaType​()
        Returns the HTTP media type: It consists of the Media-Top-Level-Type ( getTopLevelType() and the Media-Subtype ( MediaTypeAccessor.getMediaType()) as well as some (optional) suffixed parameters (as of Keys.keySet() and Keys.get(Object), mutable via Keys.MutableValues.put(Object, Object)) all being concatenated in an HTTP valid manner, such as: "application/json;charset=UTF-8".
        Specified by:
        toHttpMediaType in interface HttpMediaType
        Specified by:
        toHttpMediaType in interface HttpMediaTypeAccessor.HttpMediaTypeProvider<java.lang.String>
        Returns:
        The HTTP header Media-Type as of the IANA specification.