Class RealmDictionary<V>
- java.lang.Object
-
- io.realm.RealmMap<String,V>
-
- io.realm.RealmDictionary<V>
-
- Type Parameters:
V
- the type of the values stored in this dictionary
- All Implemented Interfaces:
io.realm.internal.Freezable<RealmMap<String,V>>
,io.realm.internal.ManageableObject
,Map<String,V>
public class RealmDictionary<V> extends RealmMap<String,V>
Specialization ofRealmMap
s whose keys are strings.Similarly to
RealmList
s, a RealmDictionary can operate in managed and unmanaged modes. In managed mode a RealmDictionary persists all its contents inside a Realm whereas in unmanaged mode it functions like aHashMap
.Managed RealmDictionaries can only be created by Realm and will automatically update its content whenever the underlying Realm is updated. Managed RealmDictionaries can only be accessed using the getter that points to a RealmDictionary field of a
RealmObject
.Unmanaged RealmDictionaries can be created by the user and can contain both managed and unmanaged RealmObjects. This is useful when dealing with JSON deserializers like GSON or other frameworks that inject values into a class. Unmanaged RealmDictionaries can be added to a Realm using the
Realm.copyToRealm(Iterable, ImportFlag...)
method.
-
-
Constructor Summary
Constructors Constructor Description RealmDictionary()
Instantiates a RealmDictionary in unmanaged mode.RealmDictionary(Map<String,V> map)
Instantiates a RealmDictionary in unmanaged mode with an initial dictionary.
-
Method Summary
-
Methods inherited from class io.realm.RealmMap
addChangeListener, addChangeListener, clear, containsKey, containsValue, entrySet, freeze, get, isEmpty, isFrozen, isManaged, isValid, keySet, put, putAll, remove, removeAllChangeListeners, removeChangeListener, removeChangeListener, size, values
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-