Constructor and Description |
---|
ContentMap() |
Modifier and Type | Method and Description |
---|---|
<T> T |
getContent(Class<T> targetType)
Returns document content of the given type.
|
int |
getContentsCount()
Returns count of currently available content types in this content map.
|
static TypeConverter |
getConversionService()
Returns conversion service for document contents.
|
boolean |
hasContent(Class<?> key)
Returns
true when this content map already contains
an element of the given type. |
<T> T |
removeContent(Class<T> key)
Removes (invalidates) document content of the given type.
|
<T> T |
setContent(Class<T> key,
T content)
Adds or replaces document content of the given type.
|
static void |
setConversionService(TypeConverter conversionService)
Sets conversion service for document contents.
|
public <T> T getContent(Class<T> targetType)
T
- inferred desired content type.targetType
- desired content type.null
when content of the
desired type is neither already present nor can be automatically
generated from an existing one.public <T> T setContent(Class<T> key, T content)
T
- inferred content type.key
- content type.content
- content; null
values are not allowed.public <T> T removeContent(Class<T> key)
T
- inferred content type.key
- content type.null
,
when no content of the given type was present.public boolean hasContent(Class<?> key)
true
when this content map already contains
an element of the given type.public int getContentsCount()
public static TypeConverter getConversionService()
public static void setConversionService(TypeConverter conversionService)
Copyright © 2018 Open eHealth Foundation. All rights reserved.