public interface AdaptiveRecord<ID_TYPE,MODEL_TYPE extends AdaptiveRecord> extends Model<ID_TYPE,MODEL_TYPE>, EnhancedAdaptiveMap<MODEL_TYPE>
The AdaptiveRecord
interface specifies a special Model
in that the fields/columns could be implicitly defined by database
SimpleBean.ByteCodeEnhancer, SimpleBean.ByteCodeScanner, SimpleBean.MetaInfo, SimpleBean.MetaInfoManager
EnhancedAdaptiveMap.MetaInfo, EnhancedAdaptiveMap.Util
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
asMap()
Returns a Map typed object backed by this active record
|
boolean |
containsKey(String key)
Check if the active records has a value associated with key specified
|
Set<Map.Entry<String,Object>> |
entrySet()
Returns a set of entries stored in the active record
|
<T> T |
getValue(String key)
Get value from the active record by key specified
|
Map<String,Object> |
internalMap() |
Set<String> |
keySet()
Returns a set of keys that has value stored in the active record
|
MODEL_TYPE |
mergeValue(String key,
Object val)
Merge a key/val pair in the active record.
|
MODEL_TYPE |
mergeValues(Map<String,Object> kvMap)
Merge all key/val pairs from specified kv map into this active record
|
EnhancedAdaptiveMap.MetaInfo |
metaInfo()
Returns the meta info of this AdaptiveRecord
|
MODEL_TYPE |
putValue(String key,
Object val)
Add or replace a key/val pair into the active record
|
MODEL_TYPE |
putValues(Map<String,Object> kvMap)
Add all key/val pairs from specified kv map into this active record
|
int |
size()
Get the size of the data stored in the active record
|
Map<String,Object> |
toMap()
Export the key/val pairs from this active record into a map
|
Map<String,Object> internalMap()
internalMap
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
MODEL_TYPE putValue(String key, Object val)
Add or replace a key/val pair into the active record
putValue
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
key
- the keyval
- the valueMODEL_TYPE mergeValue(String key, Object val)
Merge a key/val pair in the active record.
If the key specified does not exists then insert the key/val pair into the record.
If there are existing key/val pair then merge it with the new one:
mergeValue
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
key
- the keyval
- the valueMODEL_TYPE putValues(Map<String,Object> kvMap)
Add all key/val pairs from specified kv map into this active record
putValues
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
kvMap
- the key/value pairsMODEL_TYPE mergeValues(Map<String,Object> kvMap)
Merge all key/val pairs from specified kv map into this active record
mergeValues
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
kvMap
- the key/value pairsmergeValue(String, Object)
<T> T getValue(String key)
Get value from the active record by key specified
getValue
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
T
- the generic type of the valuekey
- the keynull
if not foundMap<String,Object> toMap()
Export the key/val pairs from this active record into a map
toMap
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
int size()
Get the size of the data stored in the active record
size
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
boolean containsKey(String key)
Check if the active records has a value associated with key specified
containsKey
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
key
- the keytrue
if there is value associated with the key in the record, or false
otherwiseSet<String> keySet()
Returns a set of keys that has value stored in the active record
keySet
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
Set<Map.Entry<String,Object>> entrySet()
Returns a set of entries stored in the active record
entrySet
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
Map<String,Object> asMap()
Returns a Map typed object backed by this active record
asMap
in interface org.osgl.util.AdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
EnhancedAdaptiveMap.MetaInfo metaInfo()
Returns the meta info of this AdaptiveRecord
metaInfo
in interface EnhancedAdaptiveMap<MODEL_TYPE extends AdaptiveRecord>
Copyright © 2014–2021 ActFramework. All rights reserved.