@StableMinor(version="12.0", sinceVersion="4.0") public abstract class AbstractSourceData extends Object implements ISourceData
ISourceData
that implements the default
convertion behaviour. This convertion behaviour assumes the key is equals
to the field id in the source.
This implementation does no conversion during
the put method, it does conversion only during the get method. But it offers
the convertValue(String, Class, Object)
method to be used by
it subclasses in the put implementation.
Modifier and Type | Field and Description |
---|---|
protected Source |
source
The source this source data belongs to.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractSourceData()
Creates a source data without source associated.
|
protected |
AbstractSourceData(Source source)
Creates a source data associated with the given source.
|
Modifier and Type | Method and Description |
---|---|
protected <T> T |
convertValue(String key,
Class<T> expectedClass,
Object value)
Converts a value that is associated with a given key.
|
<T> T |
get(Object key,
Class<T> expectedClass)
Returns a data value, converted to the expected class.
|
protected Class<?> |
getValueClass(String key)
Returns the class the value of the given key is to be kept as.
|
void |
putAll(Map<? extends String,? extends Object> t) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
protected final Source source
protected AbstractSourceData(Source source)
source
- the source that this data will belong to.protected AbstractSourceData()
source
- the source that this data will belong to.protected <T> T convertValue(String key, Class<T> expectedClass, Object value)
T
- the expected return class.key
- the key.expectedClass
- the expected return class.value
- the value to be converted.protected Class<?> getValueClass(String key)
key
- the key.public <T> T get(Object key, Class<T> expectedClass)
ISourceData
get
in interface ISourceData
T
- the expected class.key
- the data entry key.expectedClass
- the expected class.LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.