Package org.openehealth.ipf.commons.core
Class ContentMap
java.lang.Object
org.openehealth.ipf.commons.core.ContentMap
- Direct Known Subclasses:
Document
Content map based on Spring type conversion framework.
- Author:
- Dmytro Rud TODO this is only used in ipf-commons-ihe-xds
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetContent(Class<T> targetType) Returns document content of the given type.intReturns count of currently available content types in this content map.static TypeConverterReturns conversion service for document contents.booleanhasContent(Class<?> key) Returnstruewhen this content map already contains an element of the given type.<T> TremoveContent(Class<T> key) Removes (invalidates) document content of the given type.<T> TsetContent(Class<T> key, T content) Adds or replaces document content of the given type.static voidsetConversionService(TypeConverter conversionService) Sets conversion service for document contents.
-
Constructor Details
-
ContentMap
public ContentMap()
-
-
Method Details
-
getContent
Returns document content of the given type.- Type Parameters:
T- inferred desired content type.- Parameters:
targetType- desired content type.- Returns:
- content of the given type, or
nullwhen content of the desired type is neither already present nor can be automatically generated from an existing one.
-
setContent
Adds or replaces document content of the given type.- Type Parameters:
T- inferred content type.- Parameters:
key- content type.content- content;nullvalues are not allowed.- Returns:
- the given content, as convenience.
-
removeContent
Removes (invalidates) document content of the given type.- Type Parameters:
T- inferred content type.- Parameters:
key- content type.- Returns:
- Obsolete content of the given type, or
null, when no content of the given type was present.
-
hasContent
Returnstruewhen this content map already contains an element of the given type. -
getContentsCount
public int getContentsCount()Returns count of currently available content types in this content map. -
getConversionService
Returns conversion service for document contents. -
setConversionService
Sets conversion service for document contents.
-